Answer the question
In order to leave comments, you need to log in
How to install twig on yii2?
I did everything as described www.yiiframework.com/doc-2.0/guide-tutorial-templa...
I put yii2-app-basic
in web.php
'view' => [
'class' => 'yii\web\View',
'renderers' => [
'twig' => [
'class' => 'yii\twig\ViewRenderer',
'cachePath' => '@runtime/Twig/cache',
//'options' => [], /* Array of twig options */
'globals' => ['html' => 'yii\helpers\Html'],
'uses' => ['yii\bootstrap'],
],
],
],
public function actionIndex(){
return $this->render('index.twig');
}
Answer the question
In order to leave comments, you need to log in
It is necessary to disable the default layout of the application
$config = [
'layout' => false,
]
class BaseController extends Controller
{
public $layout = false;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question