Skip to content
This repository has been archived by the owner on Jan 15, 2023. It is now read-only.

xiaoler/yii2-blade

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

yii2-blade

将 Laravel 的 PHP 模板引擎 Blade 移植到 yii2。

使用方式:

// 在 web.php 中增加配置
'view' => [
    'class' => 'yii\web\View',
    'defaultExtension' => 'php',
    'renderers' => [
        'tpl' => [
            'class' => 'Xiaoler\Blade\Yii\ViewRenderer',
        ],
    ],
],

注意:

php 文件本身没必要无需使用 blade 解析。如果使用,由于无法将 $this 伪变量指向 yii\web\View 的实例,所以使用 $view 变量替代。

引擎将视图文件目录指向 @app/views,引用模板文件时请带上文件子目录,如 site.index

Blade 文档:http://laravel.com/docs/5.1/blade

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages