goetas / twital-bundle
Twital 模板引擎 Symfony 扩展包
1.6.0
2024-05-02 16:38 UTC
Requires
- php: ^5.5.9|^7.0|^8.0
- goetas/twital: ^1.1
- symfony/twig-bundle: ^3.0|^4.0|^5.0|^6.0
- symfony/yaml: ^3.0|^4.0|^5.0|^6.0|^6.0|^7.0
- twig/twig: ^1.38|^2.4|^3.0
Requires (Dev)
- jms/translation-bundle: ^1.0
- kriswallsmith/assetic: ^1.0
- phpunit/phpunit: ^4.8.28|^5.6.3|^6.0|^7.0|^8.0
- symfony/framework-bundle: ^3.0|^4.0|^5.0|^6.0
- symfony/templating: ^3.0|^4.0|^5.0
- symfony/var-dumper: ^3.0|^4.0|^5.0
This package is auto-updated.
Last update: 2024-09-02 17:17:44 UTC
README
TwitalBundle (Twital with Symfony)
TwitalBundle 是一个将 Symfony 模板引擎集成到 Synfony2 框架中的 Twital 模板引擎扩展包。这允许你使用 Twital 模板引擎语言语法来使用所有 Twig/Symfony 功能。
要了解更多关于 Twital 的信息,你可以阅读专用文档。
安装
推荐使用 Composer 安装 TwitalBundle。
composer require 'goetas/twital-bundle'
如果你使用 Symfony Flex,该扩展包将被自动启用和配置,否则请按照以下步骤操作。
启用扩展包
要在内核中启用扩展包
<?php // app/AppKernel.php public function registerBundles() { $bundles = array( // ... new Goetas\TwitalBundle\GoetasTwitalBundle(), //.. ); }
配置
为了让其正常工作,你需要在 config.yml
中启用 twital
模板引擎。
framework: templating: engines: ['twig', 'twital'] #optional configurations for file extension matching goetas_twital: source_adapter: - { service: twital.source_adapter.xml, pattern: ['/\.xml\.twital$/', '/\.atom\.twital$/'] } - { service: twital.source_adapter.html5, pattern: ['/\.html\.twital$/', '/\.htm\.twital$/'] } - { service: twital.source_adapter.xhtml, pattern: ['/\.xhtml\.twital$/'] }
文档
访问http://twitalbundle.readthedocs.org/ 了解 TwitalBundle 的更详细文档。
集成
TwitalBundle 包含了 TwigBundle 已经支持的 所有功能(表单、翻译、Assetic、路由等)。