gkralik / zf3-smarty-module
Laminas / ZF3 模块,提供 Smarty 渲染策略
2.4.0
2022-05-19 09:09 UTC
Requires
- php: ^7.1 || ^8.0 || ^8.1
- laminas/laminas-dependency-plugin: ^2.0
- laminas/laminas-servicemanager: ^3.0
- laminas/laminas-view: ^2.0
- smarty/smarty: ^3.1 || ^4.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.18
- phpstan/phpstan: ^0.12.78
README
这是一个用于将 Smarty 模板引擎与 Laminas 或 Zend Framework 3 集成的模块。
2.x 版本支持 Laminas。
1.x 版本支持 Zend Framework 3。请参阅分支 1.x
使用 Composer 安装
通过 Composer 安装是唯一支持的方法。
composer require gkralik/zf3-smarty-module:2.0.0
配置
有关支持选项的信息,请参阅 模块配置文件。
还有一个包含所有可用配置选项的 示例配置文件。
您可以在 smarty_options
配置键下设置 Smarty 引擎的选项(例如 force_compile
等)。
注意 compile_dir
和 cache_dir
键。Smarty 需要指定目录的写访问权限。
文档
使用 Zend Framework 视图助手
支持使用 ZF3 视图助手。只需像在 PHTML 模板中一样调用视图助手即可。
{$this->doctype()} {$this->basePath('some/path')}