Yii 1.1: extsitemap

生成网站地图
2 followers

使用方法如下

$sitemap = Yii::app()->createComponent(array(
    'class'=>'此扩展的类文件位置',
    'dateFormater'=>'Y-m-d H:i:s'
));
 
$urlItem1 = $sitemap->createUrlItem();
$urlItem1->loc = Yii::app()->createUrl('/');//网站首页
$urlItem1->lastmod = time();
$urlItem1->priority = '1.0';
$rulItem1->changefreq = 'daily';
$sitemap->addUrlItem($urlItem1);
 
//添加更多
 ...
//显示
$sitemap->render();

Be the first person to leave a comment

Please to leave your comment.

Create extension
Downloads
  • Yii Version: 1.1
  • License: New BSD License
  • Developed by: 张 迪
  • Category: Others
  • Votes: +1 / -1
  • Downloaded: 339 times
  • Created on: Dec 7, 2011
  • Last updated: Dec 20, 2012
  • Tags: sitemap