xyb / yii2-blade
The blade integration for the Yii framework
Installs: 61
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 3
Forks: 1
Type:yii2-extension
Requires
- yiisoft/yii2: *
This package is not auto-updated.
Last update: 2024-11-09 20:12:23 UTC
README
yii2集成laravel的blade模板引擎
并没继承Laravel中的模板继承、视图片断功能。
安装
composer.json 添加一行
"xyb/yii2-blade": "*"
执行composer update就ok了。
#使用 'view' => [ 'class' => 'yii\web\View', 'renderers' => [ 'blade' => [ 'class' => 'xyb\blade\ViewRenderer', //'cachePath' => '@runtime/blade', ], ], ],
默认会把layout的.php换成.blade,也就是说layout => main,会加载layouts/main.blade而不是layouts/main.php,同时渲染模板时候这样调用 $this->render('tpl.blade')