eastern-color / sitemap-bundle
这个Symfony扩展提供了一种管理你的网站地图的另一种方式。
1.0.2
2018-03-05 07:27 UTC
Requires
- php: >=5.5.9
- doctrine/orm: ^2.5
This package is auto-updated.
Last update: 2024-09-29 05:01:53 UTC
README
这个Symfony扩展提供了一种管理你的网站地图的另一种方式。
安装
composer require eastern-color/sitemap-bundle
- 在symfony的 /app/AppKernel.php 中启用扩展
new EasternColor\SitemapBundle\EasternColorSitemapBundle()
,
先决条件
- 您必须在Symfony的 config.yml 中设置 "framework.templating"
待办事项
- 移除对容器的服务依赖
- 扩展此README
命令
ec:sitemap:generate
- 选项:
--gzip
- 选项:
基本用法(路由选项)
- 简单地将选项
sitemap
添加到任何路由中。- xml:
<option key="sitemap">true</option>
- xml:
- 您可以使用Symfony参数提供一系列区域,命名为 locales
- 例如:
locales: ['en', 'zh']
- 例如:
高级用法(自定义服务提供者)
- 创建symfony服务提供者
namespace AppBundle; use EasternColor\SitemapBundle\Services\SitemapXmlGeneratorProvider\SitemapXmlGeneratorProviderBase; class MySitemapXmlGeneratorProvider extends SitemapXmlGeneratorProviderBase { }
许可证
此扩展受MIT许可证的约束。