X-Bird / Smarty by x-bird
forked from latrell/Smarty

改自latrell/smarty,增加配置项,让其支持fis smarty插件的配置项.
493
3
2
Package Data
Maintainer Username: x-bird
Maintainer Contact: x-bird@qiubs.com (X-Bird)
Package Create Date: 2014-12-11
Package Last Update: 2017-06-22
Home Page:
Language: PHP
License: MIT
Last Refreshed: 2024-12-11 15:26:11
Package Statistics
Total Downloads: 493
Monthly Downloads: 1
Daily Downloads: 0
Total Stars: 3
Total Watchers: 2
Total Forks: 2
Total Open Issues: 0

Laravel 5.4 + Fis3 静态资源管理系统

安装

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