2017 © Pedro Peláez
 

yii2-extension yii2-sitemap

Yii2 generation Sitemap XML

image

enchikiben/yii2-sitemap

Yii2 generation Sitemap XML

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

yii2-sitemap

Installation

The preferred way to install this extension is through composer., (*1)

php composer.phar require --prefer-dist "enchikiben/yii2-sitemap" "*"

or, (*2)

"enchikiben/yii2-sitemap" : "*"

Configure

'modules' => [
    'sitemap' => [
        'class' => 'enchikiben\sitemap\Sitemap',
        'controllerDirAlias' => '@frontend/controllers'
    ],
],

Add a new rule for urlManager of your application's configuration file, for example:, (*3)

'urlManager' => [
    'rules' => [
        ['pattern' => 'sitemap', 'route' => 'sitemap/default/index', 'suffix' => '.xml'],
    ],
],

Use

class SiteController extends Base
{

    /**
     * @sitemap priority=1
     */
    public function actionIndex()
    {
    } 

    /**
     * @sitemap priority=0.8
     */
    public function actionConfidentiality()
    {
    }
}

or, (*4)

class NewsController extends Base
{
    /**
     * @sitemap priority=0.5 changefreq=monthly route=['/news/view','id'=>$model->id] model=common\models\News condition=['status'=>1]
     */
    public function actionView($id)
    {

    }
}

The Versions

22/09 2016

dev-master

9999999-dev

Yii2 generation Sitemap XML

  Sources   Download

MIT

The Requires

 

xml yii2 module sitemap