soldotno / zf2_smarty3
此软件包已被废弃,不再维护。未建议替代软件包。
为 Zend Framework 2 设计的 Smarty 模板引擎模块
1.2.0
2013-06-12 19:02 UTC
Requires
- php: >=5.3.3
- smarty/smarty: 3.1.*
- zendframework/zendframework: 2.*
This package is not auto-updated.
Last update: 2020-01-19 16:49:33 UTC
README
SmartyModule 是一个将 Smarty 模板引擎与 Zend Framework 2 集成的模块。
版本:1.0.0
安装
Composer
- 将
"soldotno/smarty3": "dev-master"
添加到您的composer.json
文件中,并运行 php composer.phar update。 - 将 SmartyModule 添加到您的
config/application.config.php
文件中的 modules 键下。
手动安装
- 在
vendor
目录下执行git clone https://github.com/soldotno/zf2_smarty3.git
- 将 Smarty 放入
vendor
目录 - 设置 autoloader 以加载 Smarty。
- 将 SmartyModule 添加到您的
config/application.config.php
文件中的 modules 键下。
配置
修改您的应用程序配置如下
...
'view_manager' => array(
'default_suffix' => 'tpl', // <-- new option for path stack resolver
'display_not_found_reason' => true,
'display_exceptions' => true,
'doctype' => 'HTML5',
'not_found_template' => 'error/404',
'exception_template' => 'error/index',
'template_map' => array(
'layout/layout' => __DIR__ . '/../view/layout/layout.tpl',
'application/index/index' => __DIR__ . '/../view/application/index/index.tpl',
'error/404' => __DIR__ . '/../view/error/404.tpl',
'error/index' => __DIR__ . '/../view/error/index.tpl',
),
'template_path_stack' => array(
__DIR__ . '/../view',
),
),
...
有关视图管理器的更多信息: Zend\View。