phile / template-smarty
该软件包已被弃用,不再维护。未建议替代软件包。
用于PhileCMS的smarty模板解析器
dev-master
2018-03-24 13:55 UTC
Requires
- phile-cms/phile: >=1
- phile-cms/plugin-installer-plugin: >=1
- smarty/smarty: v3.1.15
This package is not auto-updated.
Last update: 2020-01-24 15:12:14 UTC
README
注意:此仓库不再维护并已存档。
phileTemplateSmarty
Smarty(包括3.1.15版本)模板解析器,用于PhileCMS
1.1 安装(Composer)
php composer.phar require phile/template-smarty:*
1.2 安装(下载)
- 安装Phile的最新版本
- 将此仓库克隆到
plugins/phile/templateSmarty
2. 激活
安装插件后,您需要将以下行添加到您的config.php
文件中
$config['plugins']['phile\\templateSmarty'] = array('active' => true);
修改您的config.php
文件
$config['plugins'] = array( // disable the Twig template engine 'phile\\templateTwig' => array('active' => false), // enable the Smarty template engine 'phile\\templateSmarty' => array('active' => true) );
免责声明
由于Phile中页面模型的特点以及Smarty不喜欢对象的事实,pages
数组中可用的一些属性略有不同。
- 标题
- URL
- 内容
- 元数据
这涵盖了pages
数组在Twig中所覆盖的大部分内容。
不是Twig的替代品
如果您之前没有使用过Smarty,请阅读文档,因为语法和哲学上与Twig有一些差异。
我包含了一个index.tpl文件,以展示如何从默认主题重新创建索引页面。
为什么选择这个而不是Twig
- 您更喜欢Smarty的语法/风格/哲学
- Smarty的社区比Twig大(Smarty比Twig更老)
- 有些人认为Smarty比Twig快