yiisoft/yii2-twig

wrong documentation installation

antgubarev opened this issue · 5 comments

[
    'components' => [
        'view' => [
            'class' => 'yii\web\View',
            'renderers' => [
                'twig' => [
                    'class' => 'yii\twig\ViewRenderer',
                    'cachePath' => '@runtime/Twig/cache',
                    // Array of twig options:
                    'options' => [
                        'auto_reload' => true,
                    ],
                    'globals' => [
                        'html' => ['class' => '\yii\helpers\Html'],
                    ],
                    'uses' => ['yii\bootstrap'],
                ],
                // ...
            ],
        ],
    ],
]
 'html' => ['class' => '\yii\helpers\Html']

dont work, but

'html' => '\yii\helpers\Html'

work

Additional info

Q A
Yii vesion 2.0.11
PHP version 7.1

I forgot to say that

{{ html.csrfMetaTags | raw }}

or other methods throw exception

Confirm.

Anyone want to work on a fix?

Minute. I will make a PR.

Thank you!