Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Class 'Twig_Extension' not found #39

Closed
babeuloula opened this issue Jan 16, 2015 · 3 comments
Closed

Class 'Twig_Extension' not found #39

babeuloula opened this issue Jan 16, 2015 · 3 comments

Comments

@babeuloula
Copy link

Hello,

I've a problem with Twig Extension :

    require 'vendor/autoload.php';

    $app = new \Slim\Slim(array(
        'debug' => true,
        'templates.path' => 'views/',
        'view' => new \Slim\Views\Twig(),
    ));

    $view = $app->view();
    $view->parserOptions = array(
        'debug' => true,
    );
    $view->parserExtensions = array(
        new \Slim\Views\TwigExtension()
    );




    $app->get('/hello/:name', function ($name) use ($app) {
        $app->render('hello.html.twig', array(
            'name' => $name,
        ));
    });

    $app->run();

And the error : Fatal error: Class 'Twig_Extension' not found in ***\vendor\slim\views\TwigExtension.php on line 38

Have you any ideas ?

Thanks

@DarkAxi0m
Copy link

add "twig/extensions", "*" to the composer.json require section

@babeuloula
Copy link
Author

Cool thanks

@kzoozer
Copy link

kzoozer commented Nov 1, 2017

@DarkAxi0m There is a little correction. Add "twig/extensions": "*", in require section of composer.json

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants