core/classes/TemplateLoader.class.php
public function getFinalName($name){

        try { 

            return parent::findTemplate($name);

        } catch(\Twig_Error_Loader $e){ 

            $exts = \App::config('TEMPLATE_EXTENSION');

            if($exts){

                if(!is_array($exts)){
                    $exts = Array($exts);
                }//if

                foreach($exts as $e){

                    try {
                        return parent::findTemplate($name . $e);
                    } catch(\Twig_Error_Loader $e){ }

                }//foreach

            }//if

        }//catch

        throw new \Twig_Error_Loader("Twig Error Loader Exception : Could name find template `{$name}`");

    }
public function getFinalName($name){

        try { 

            return parent::findTemplate($name);

        } catch(\Twig_Error_Loader $e){ 

            $exts = \App::config('TEMPLATE_EXTENSION');

            if($exts){

                if(!is_array($exts)){
                    $exts = Array($exts);
                }//if

                foreach($exts as $e){

                    try {
                        return parent::findTemplate($name . $e);
                    } catch(\Twig_Error_Loader $e){ }

                }//foreach

            }//if

        }//catch

        throw new \Twig_Error_Loader("Twig Error Loader Exception : Could name find template `{$name}`");

    }
public function getFinalName ( $ name ) { try { return parent :: findTemplate ( $ name ) ; } catch ( \ Twig_Error_Loader $ e ) { $ exts = \ App :: config ( 'TEMPLATE_EXTENSION' ) ; if ( $ exts ) { if ( ! is_array ( $ exts ) ) { $ exts = Array ( $ exts ) ; } //if foreach ( $ exts as $ e ) { try { return parent :: findTemplate ( $ name . $ e ) ; } catch ( \ Twig_Error_Loader $ e ) { } } //foreach } //if } //catch throw new \ Twig_Error_Loader ( "Twig Error Loader Exception : Could name find template `{$name}`" ) ; }
Get the final name where a template lives, regardless of whether it was called with an extension or not.


@param string $name The template name.
@return string The final template name.

@throws \Twig_Error_Loader
Get the final name where a template lives regardless of whether it was called with an extension or not .