1. Go to this page and download the library: Download insolita/yii2-extview library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
insolita / yii2-extview example snippets
'modules'=>[
'someModule'=>[
'class'=>'\some\Module',
'prop'=>'foo',
'as extview'=>[
'class'=>'insolita\extview\ExtviewBehavior',
'viewExtension'=>'twig' //it set twig extension for all module controllers
//Or with anonymous function with argument $route (equals \yii\base\Action $uniqueId property )
'viewExtension'=>function($route){
return($route=='some-module/default/index')?'php':'twig';
}
]
]
]