x-bird/smarty

基于latrell/smarty修改,增加了配置项,使其支持fis smarty插件的配置项。

维护者

详细信息

github.com/X-Bird/Smarty

源代码

1.4 2017-06-03 16:10 UTC

This package is not auto-updated.

Last update: 2024-09-28 17:33:14 UTC


README

安装

composer require x-bird/smarty

配置

  • config/app.php 文件中配置:
    'providers' => array(
        // ...
        Xbird\Smarty\SmartyServiceProvider::class,
    )
  • 执行发布配置文件:php artisan vendor:publish --provider="Xbird\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