mainio / c5-twig-templates
该软件包已被废弃,不再维护。未建议替代软件包。
使 concrete5 能够使用 twig 模板。
v0.1.9
2016-06-28 14:12 UTC
Requires
- php: >=5.3.3
- symfony/twig-bridge: 2.5.*
This package is not auto-updated.
Last update: 2021-11-27 03:17:34 UTC
README
这是一个 composer 软件包,为 concrete5 提供使用 twig 模板的可能性。目前它仅适用于单页,未来它还应在 concrete5 的其他区域工作。
如何使用?
将 composer.json 文件添加到您的 concrete5 软件包目录中。在该文件中,添加以下内容
{
"require": {
"mainio/c5-twig-templates": "*"
}
}
然后,在同一目录下运行 composer install
。之后,在您的软件包控制器顶部(在命名空间定义之后)添加以下内容
include(dirname(__FILE__) . '/vendor/autoload.php');
在开发 twig 视图时,建议您将以下配置添加到您的 application/config/app.php
return array( // ... some other configs ... 'twig_debug' => true // ... some other configs ... );
这可以防止模板从编译缓存中加载,这使得开发更加有趣,因为在每次页面加载后不需要刷新缓存。
如果您正在寻找代码示例,例如以下软件包使用了这个软件包
https://github.com/mainio/c5_symfony_forms_example
路线图
- 使模板在主题中工作
- 使模板在区块视图中工作
许可证
基于 MIT 许可证。有关更多信息,请参阅 LICENSE。
版权 (c) 2015 Mainio Tech Ltd.