Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Using FuelPHP dev-1.9/develop with Twig 3.*
  • Hello,

    i used twig 1.* in my projects for a long time (because it does his job) but i think its important to upgrade to twig 3 (security etc)

    I have updated a project to dev-1.9/develop and also installed twig 3 via composer. Also i have copied the parser.php config from the fuel/packages/parser/config folder to my app/configs/production folder

    But i only see a error on my site its

    "Fatal error: Method Parser\View_Twig::__toString() must not throw an exception, caught Error: Class 'Twig_Loader_Filesystem' not found in"

    Any Ideas?

    Somebody is able to create a tutorial how to setup twig 3 with fuelphp and have custom twig extentions to?

    thanks
  • HarroHarro
    Accepted Answer
    Are you using Twig directly, or via the Parser package?

    Directly should simply work, the Parser package currently supports only v1.x and v2.x.
  • Via the Parser package ... Thanks
  • I've looked at it, but it is not going to be simple.

    The loader is easy to adapt while keeping it backwards compatible, but the extension system has complete changed in Twig v3, so that may need to be rewritten.

    Can you check if you get any further with this change? https://github.com/fuel/parser/commit/93c29875b57d95baf1fb7aea600e8b13ef0195cf
  • I will check this the next days ... thanks :)

Howdy, Stranger!

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

In this Discussion