novactive / ezstatictemplatesbundle
此包用于将 twig 模板暴露给 siteaccess
Requires
- php: ^7.3 || ^8.0
This package is auto-updated.
Last update: 2024-09-16 11:37:04 UTC
README
这个仓库是我们所说的“子树拆分”:主仓库中一个目录的只读副本。它被 Composer 用来允许开发者依赖特定的包。
如果您想报告或贡献,您应该在主仓库中打开问题:https://github.com/Novactive/Nova-eZPlatform-Bundles
文档可通过此仓库中的 .md
文件获取,但还打包在此:https://novactive.github.io/Nova-eZPlatform-Bundles/master/StaticTemplatesBundle/README.md.html
Novactive eZ 静态模板包是一个 eZ Platform 包,提供了一种超简单的方法来通过 URL 访问 twig 模板。
它使用 eZ Platform 提供的 siteaccess 和 设计引擎。
功能
当您访问 siteaccess 组 static_group
中的 siteaccess 时,它将获取 URL 并显示具有对应路径的 twig 模板。
您可以配置任意数量的 siteaccess,并且使用设计引擎可以为每个 siteaccess 配置不同的主题。
由于我们使用了 siteaccess 功能,因此您还可以使用 权限 来控制访问。
示例
假设有一个主题 static_test
,将自动生成一个 siteaccess static-test
。然后通过 URI 匹配 siteaccess,URL http://localhost/static-test/news/details
将显示 themes\static_test\news\details.html.twig
中的模板。
就这样!
安装
获取包
将库添加到您的 composer.json 中,运行 composer require novactive/ezstatictemplatesbundle
以刷新依赖项。
然后将在您的应用程序的 bundles.php
中注入此包。
Novactive\Bundle\EzStaticTemplatesBundle\EzStaticTemplatesBundle::class => [ 'all'=> true ],
配置
无!
siteaccess 配置将基于以 "static_" 开头的现有主题自动生成。