Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
How to use Smarty parser with fuelphp? (Noob question)
  • Hi there. I can't understand, how to use parser package. I have downloaded Smarty, copied the 'libs' directory into app/vendor/Smarty, and what next? Can you give an example of usage? I can't understand it from manual.
  • Make sure the parser package is loaded (for example in the always_load section of your config), and give your views the extension '.smarty'.

    Then all you have to do is to replace

    View::forge('myview');

    by

    View::forge('myview.smarty');

    And the parser will take care of the rest. The extension 'smarty' is used, because the Twig template engine also uses the 'tpl' extension. If you prefer a different extension to 'smarty', you can copy the parser config file from the package to your app, and change it.


Howdy, Stranger!

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

In this Discussion