gkralik/zf3-smarty-module

Laminas / ZF3 模块,提供 Smarty 渲染策略

2.4.0 2022-05-19 09:09 UTC

This package is auto-updated.

Last update: 2024-09-19 14:23:32 UTC


README

这是一个用于将 Smarty 模板引擎与 LaminasZend 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_dircache_dir 键。Smarty 需要指定目录的写访问权限。

文档

使用 Zend Framework 视图助手

支持使用 ZF3 视图助手。只需像在 PHTML 模板中一样调用视图助手即可。

{$this->doctype()}

{$this->basePath('some/path')}