yiisoft / yii2-twig

Yii 2 Twig extension.
http://www.yiiframework.com
BSD 3-Clause "New" or "Revised" License
137 stars 61 forks source link

Class 'Twig_Loader_Filesystem' not found #100

Closed plash29 closed 6 years ago

plash29 commented 6 years ago

| Yii vesion 2 | | PHP version 5.6 | | Operating system | window 7

yii-bot commented 6 years ago

Thanks for posting in our issue tracker. In order to properly assist you, we need additional information:

Thanks!

This is an automated comment, triggered by adding the label status:need more info.

plash29 commented 6 years ago

When does the issue occur? I have installed https://github.com/bubasuma/yii2-simplechat extension. After extending their classes i got this issue. I am using twig as the template engine.

What do you see?
PHP Fatal Error – yii\base\ErrorException Class 'Twig_Loader_Filesystem' not found

What was the expected result? I should have got the chatting as shown in the extension docs.

samdark commented 6 years ago

Please provide more info. We won't be able to reproduce it and we aren't going to dig into third party extension to find out details...

plash29 commented 6 years ago

I use this command to install the twig.

"require": { "yiisoft/yii2-twig": "> 2.0.4", "bower-asset/twig.js" : "0.8.4@stable" }, After run the composer : I write the code in config/web.php

    'view' => [
        'renderers' => [
            'twig' => [
                'class' => 'yii\twig\ViewRenderer',
                // set cachePath to false in order to disable template caching
                'cachePath' => false, //'@runtime/Twig/cache',
                // Array of twig options:
                'options' => [
                    'auto_reload' => true,
                ],
                // add Yii helpers or widgets here
                'globals' => [
                    'html' => '\yii\helpers\Html',
                ]
            ]
        ]
    ],

It show the twig layout file code on browser. html encode this title 1

plash29 commented 6 years ago

After write the code in web.php i got issue yii_base_errorexception

samdark commented 6 years ago

Try Twig 2.2.0 and don't specify bower-asset/twig.js