enlitepro/enlite-sitemap

此包的最新版本(v1.2.0)没有提供许可证信息。

用于生成静态网站地图的ZF2模块

v1.2.0 2014-09-09 08:06 UTC

This package is not auto-updated.

Last update: 2024-09-24 01:33:00 UTC


README

安装

推荐通过composer安装。

{
    "require": {
        "enlitepro/enlite-sitemap": "1.0.*"
    }
}

使用方法

EnliteSitemap 添加到您的 config/application.config.php 中以启用模块。

您可以在“sitemap”部分添加到导航中的静态URL。

对于动态URL,您需要

  1. 将实现 EnliteSitemap\Navigation\DynamicPagesInterface 添加到任何服务中。此服务必须可以通过服务定位器获取。
  2. 将服务的键添加到
[
    'EnliteSitemap' => [
            'common' => [
                'dynamic_pages' => [
                    'YouService'
                ],
            ],
        ],
]

配置

例如配置

[
    'EnliteSitemap' => [
            'common' => [
                // The name site map or site map index (if some files)
                'index_file' => 'sitemap.xml',
                // The name of site map. Use when a site map is some files
                'non_index_file' => 'sitemap%d.xml',
                'public_path' => 'public',
                'limit_url_in_file' => 50000,
                'dynamic_pages' => [],
            ],
            // URL for all links in site map
            'url' => [
                'host' => 'my.site.com',
                'port' => 80,
                'scheme' => 'http',
            ]
        ],
]

注意

对于创建 Zend\Navigation\Page\Mvc,我们建议使用 EnliteSitemap\Service\SitemapService::factoryMVCPage()