Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Smarty extension
  • Hi all,

    I'm using the 1.8.* installation for all parts and I really want to use the '.tpl' extension for my Smarty templates. It looks like the parser config file is not being read properly? 

    I have to forge the views with '.smarty', I have to name the templates with '.smarty' and I have to call the extension in parser config 'smarty' to get it to work at all.

    According to the following post this is the accepted solution, but my IDE doesn't understand '.smarty' files... 


    Anyone?

    Many thanks,
    /Andy
  • HarroHarro
    Accepted Answer
    The parser configuration requires a unique expension for every parser, and since .tpl was already used, we have to come up with another default for smarty.

    However, nobody is stopping you from overriding the config in your app. This should do it:

    return array(

        // ------------------------------------------------------------------------
        // Swap extensions of Dwoo and Smarty
        // ------------------------------------------------------------------------
        'extensions' => array(
            'dwoo'     => View_Dwoo',
            'smarty'   => array('class' => 'View_Smarty', 'extension' => 'tpl'),
        ),
    );
  • Yeah, already have that, but that's what doesn't work... I need to use '.smarty' all the way through as extension to make it find the template.
  • Ah, figured it out now... forge with '.tpl', and call the files '.tpl'... so simple, sorry!
  • No worries. ;-)

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion