pieceofcake2/sitemap
最新稳定版本:v1.0.3
Composer 安装命令:
composer require pieceofcake2/sitemap
包简介
A CakePHP 2 Plugin for adding automatic XML and HTML Sitemaps to an app
README 文档
README
This is forked for CakePHP2.
A CakePHP 2.x Plugin for adding automatic XML and HTML Sitemaps to an CakePHP app
Background
- Only generates a sitemap currently for models in the core App, not in Plugins.
- Generates an HTML list using a dl list.
- Generates an sitemap.xml file as well.
- View caching used for the HTML files.
- Allows for setting a custom callback function to build urls.
Requirements
- PHP 8.0+
- CakePHP 2.10+
Installation
Composer
$ composer require pieceofcake2/sitemap
Usage
- Add this this line to your
bootstrap.php:
CakePlugin::load(['Sitemap' => ['routes' => true]]);
- Add the behavior to the model desired to generate a sitemap for that model
public $actsAs = [ 'Sitemap.Sitemap' => [ 'primaryKey' => 'id', // Default primary key field 'loc' => 'buildUrl', // Default function called that builds a url, passes parameters (Model $Model, $primaryKey) 'lastmod' => 'modified', // Default last modified field, can be set to FALSE if no field for this 'changefreq' => 'daily', // Default change frequency applied to all model items of this type, can be set to FALSE to pass no value 'priority' => '0.9', // Default priority applied to all model items of this type, can be set to FALSE to pass no value 'conditions' => [], // Conditions to limit or control the returned results for the sitemap ] ];
- Sitemap should now be visible at /sitemap and /sitemap.xml
Contributing
Reporting Issues
Please use GitHub Isuses for listing any known defects or issues.
License
Copyright
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-10-07