xfeng / smarty
基于latrell/smarty修改,增加配置项,使其支持fis smarty插件的配置项。
1.2.1
2018-03-07 01:53 UTC
Requires
- php: >=7.0.0
- illuminate/support: 5.5.*
- smarty/smarty: 3.1.27
This package is not auto-updated.
Last update: 2024-09-20 02:49:58 UTC
README
安装
composer require xfeng/smarty
配置
- 在
config/app.php文件中配置:
'providers' => array( // ... xfeng\Smarty\SmartyServiceProvider::class, )
- 执行发布配置文件:
php artisan vendor:publish --provider="xfeng\Smarty\SmartyServiceProvider" --tag=config --tag=plugins
使用
- 添加providers:
- 假设有模板文件
views/blog/post.tpl,那在controller中是这样渲染的,View::make('blog.post') - 关于
{include}或{extends}标签的参数传递,需要使用全路径的写法,例如:{extends file="blog/post.tpl"}
配置项解释
- 模板放置路径:
template_path - 模板缓存路径:
cache_path - 模板编译路径:
compile_path - fis3 产出的namespace-map.json 放置路径:
configs_paths