2017 © Pedro Peláez
 

yii2-extension sitemap-generator

Yii2 component for generate sitemap.xml files.

image

dreamjobs/sitemap-generator

Yii2 component for generate sitemap.xml files.

  • Saturday, July 22, 2017
  • by seboraid
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1,160 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 10 Versions
  • 21 % Grown

The README.md

yii2-sitemap-generator

Yii2 component for generate sitemap.xml files, (*1)

Installation

Run, (*2)

php composer.phar require "dreamjobs/sitemap-generator" "~1.0"

or, (*3)

Add to composer.json in your project, (*4)

{
    "require": {
        "dreamjobs/sitemap-generator": "~1.0"
    }
}

then run command, (*5)

php composer.phar update

Configuration

Edit "./console/config/main.php", (*6)

return [
    'controllerMap' => [
        'sitemap' => [
            'class' => 'dreamjobs\sitemap\SitemapController',
            'baseUrl' => 'https://dreamjobs.com.co',
            'modelsPath' => '@console/models/sitemap', // Sitemap-data models directory
            'modelsNamespace' => 'console\models\sitemap', // Namespace in [[modelsPath]] files
            'savePathAlias' => '@frontend/web', // Where would be placed the generated sitemap-files
            'sitemapFileName' => 'sitemap.xml', // Name of main sitemap-file in [[savePathAlias]] directory
        ],
    ],
];

"./environments/prod/console/config/main-local.php", (*7)

'components' => [
    // fix console create url
    'urlManager' => [
        'baseUrl' => 'http://example.com',
    ],
],

"./environments/dev/console/config/main-local.php", (*8)

'components' => [
    // fix console create url
    'urlManager' => [
        'baseUrl' => 'http://example.local',
    ],
],

run command, (*9)

php ./init

OR just apply same config to your "/console/config/main-local.php", (*10)

ALSO you can merge urlManager rules from frontend(or common) to console config. Just change "/console/config/main.php" file:, (*11)

// get config of urlManager from frontend for correctly create urls in console app
$frontend = require(__DIR__ . '/../../frontend/config/main.php');
$frontendUrlManager = [
    'components' => [
        'urlManager' => $frontend['components']['urlManager'],
    ],
];

// ...

// Merge frontend urlManager config with console application main config
return yii\helpers\ArrayHelper::merge($frontendUrlManager, [
    'id' => 'app-console',
    // ...
];

Also useful append .gitignore for ignore all generated sitemaps files:, (*12)

# sitemaps
/frontend/web/sitemap*.xml

TBD: creating sitemap-data models, (*13)

Usage

Run Yii console command in project root:, (*14)

php ./yii sitemap

then check "http://site/sitemap.xml" file, (*15)

The Versions

22/07 2017

dev-master

9999999-dev https://github.com/dreamjobs/yii2-sitemap-generator#readme

Yii2 component for generate sitemap.xml files.

  Sources   Download

GNU

The Requires

 

xml yii2 cron sitemap

22/07 2017

1.1.3

1.1.3.0 https://github.com/dreamjobs/yii2-sitemap-generator#readme

Yii2 component for generate sitemap.xml files.

  Sources   Download

GNU

The Requires

 

xml yii2 cron sitemap

21/07 2017

1.1.2

1.1.2.0 https://github.com/dreamjobs/yii2-sitemap-generator#readme

Yii2 component for generate sitemap.xml files.

  Sources   Download

GNU

The Requires

 

xml yii2 cron sitemap

21/07 2017

1.1.1

1.1.1.0 https://github.com/dreamjobs/yii2-sitemap-generator#readme

Yii2 component for generate sitemap.xml files.

  Sources   Download

GNU

The Requires

 

xml yii2 cron sitemap

24/06 2015

1.1.0

1.1.0.0 https://github.com/demisang/yii2-sitemap-generator#readme

Yii2 component for generate sitemap.xml files.

  Sources   Download

GNU

The Requires

 

xml yii2 cron sitemap

19/05 2015

1.0.3

1.0.3.0 https://github.com/demisang/yii2-sitemap-generator#readme

Yii2 component for generate sitemap.xml files.

  Sources   Download

GNU

The Requires

 

xml yii2 cron sitemap

08/05 2015

1.0.2

1.0.2.0 https://github.com/demisang/yii2-sitemap-generator#readme

Yii2 component for generate sitemap.xml files.

  Sources   Download

GNU

The Requires

 

xml yii2 cron sitemap

08/05 2015

1.0.1

1.0.1.0 https://github.com/demisang/yii2-sitemap-generator#readme

Yii2 component for generate sitemap.xml files.

  Sources   Download

GNU

The Requires

 

xml yii2 cron sitemap

08/05 2015

1.0.0

1.0.0.0 https://github.com/demisang/yii2-sitemap-generator#readme

Yii2 component for generate sitemap.xml files.

  Sources   Download

GNU

The Requires

 

xml yii2 cron sitemap

07/05 2015

0.1.0

0.1.0.0 https://github.com/demisang/yii2-sitemap-generator#readme

Yii2 component for generate sitemap.xml files.

  Sources   Download

GNU

The Requires

 

xml yii2 cron sitemap