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 plugins
  • I want to use the Smarty Extensions.

    I have installed Smarty and have set this in parser.php:

      return array(
        'extensions' => array( 'tpl' => 'View_Smarty' ),
      );

    My action function is:

      public function action_index() {
        return Response::forge(View::forge('home/index.tpl'));
      }

    The view file attempts to use the fuel_version() function:

    {fuel_version()}

    I get:

    SmartyCompilerException [ Error ]:
    Syntax error in template .../fuel/app/views/home/index.tpl"
    on line 3 "{fuel_version()}"
    unknown function "fuel_version"

    =============================

    What am I missing?

    Thanks.

  • HarroHarro
    Accepted Answer
    My Smarty is very rusty, but afaik you don't call functions that way, you use {fuel_version}, see http://www.smarty.net/docs/en/plugins.functions.tpl
  • Yes, you're absolutely right.
    No parens.

    Thanks.

Howdy, Stranger!

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

In this Discussion