xaraya/twig
最新稳定版本:2.9.4
Composer 安装命令:
composer require xaraya/twig
包简介
Use Twig template engine with Xaraya
README 文档
README
Xaraya has been using Blocklayout for templates since the early days. The Twig bridge included in Xaraya core allows you to use Twig-based templates to generate output in Xaraya if needed, with a number of Xaraya-specific extensions.
This repository contains the Twig templates converted from Blocklayout for different modules, blocks, properties and themes.
Twig Namespaces
In general modules templates are mapped to their equivalent @modname namespace. To avoid overlap (with the themes or blocks modules), themes, properties and blocks templates use the singular equivalent @theme, @property and @block namespace.
| Component | Namespace | Templates |
|---|---|---|
| Module | @base | html/code/modules/base |
| Module | @dynamicdata | html/code/modules/dynamicdata |
| Module | ... | ... |
| Theme | @theme | html/themes |
| Property | @property | html/code/properties |
| Block | @block | html/code/blocks |
Xaraya Twig Extensions
Since Blocklayout allows significant PHP processing in templates and Twig deliberately does not, many of the common API calls to static core methods have been made available as Twig functions. Similarly, most Blocklayout and Xaraya tags have their equivalent Twig functions too.
This made translation of all templates from Blocklayout to Twig feasible, but for future template development we highly recommend to prepare all needed template variables up-front in the PHP functions, and then pass them along to the template as intended.
统计信息
- 总下载量: 57
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 2
其他信息
- 授权协议: GPL-2.0-or-later
- 更新时间: 2024-03-29