2017 © Pedro Peláez
 

library yii2-sitemap-generator

Library for create and write sitemap.xml for you site. Yii2 implementation.

image

mima/yii2-sitemap-generator

Library for create and write sitemap.xml for you site. Yii2 implementation.

  • Tuesday, September 27, 2016
  • by MimaTomis
  • Repository
  • 1 Watchers
  • 1 Stars
  • 45 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 7 % Grown

The README.md

Yii2 Sitemap Generator

Build Status, (*1)

This library is implementation of mima/sitemap-generator for yii2 framework. It delivers a custom component and writer based on yii2 features. Documentation about sitemap generator library you can find here., (*2)

Installation

Install with composer from command line:, (*3)

composer require mima/yii2-sitemap-generator

Or add dependency to require section in your composer.json:, (*4)

{
    "require": {
        "mima/yii2-sitemap-generator": "~1.0"
    }
}

Usage

Configure component on runtime:, (*5)

use SitemapGenerator\Component\SitemapGeneratorComponent;
use SitemapGenerator\Factory\SimpleGeneratorFactory;
use MyNamespace\Extractor\MyDataExtractor;

\Yii::$app->set('sitemapGenerator', [
    'class' => SitemapGeneratorComponent::class,
    'directoryToSaveSitemap' => '@webroot',
    'fileName' => 'sitemap.xml',
    'extractor' => MyDataExtractor::class,
    'generatorFactory' => SimpleGeneratorFactory::class
]);

Configure in application config:, (*6)

return [
    // ...
    'components' => [
        'sitemapGenerator' => [
            'class' => SitemapGenerator\Component\SitemapGeneratorComponent::class,
            'directoryToSaveSitemap' => '@webroot',
            'fileName' => 'sitemap.xml',
            'extractor' => MyNamespace\Extractor\MyDataExtractor::class,
            'generatorFactory' => SitemapGenerator\Factory\SimpleGeneratorFactory::class
        ]
    ]
    //...
];

The following are valid settings:, (*7)

  • directoryToSaveSitemap - real path or yii alias to directory, where sitemap will be saved
  • fileName - name of sitemap file
  • extractor - name of class instance of SitemapGenerator\Extractor\DataExtractorInterface
  • generatorFactory - name of class instance of SitemapGenerator\Factory\GeneratorFactoryInterface

For generating sitemap call generate method:, (*8)

// This code generate sitemap and return path to file, containig sitemap
$filePath = \Yii::$app->get('sitemapGenerator')->generate();

The Versions

27/09 2016

dev-develop

dev-develop

Library for create and write sitemap.xml for you site. Yii2 implementation.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dmitriy Konev

27/09 2016

dev-master

9999999-dev

Library for create and write sitemap.xml for you site. Yii2 implementation.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dmitriy Konev

27/09 2016

v1.0.2

1.0.2.0

Library for create and write sitemap.xml for you site. Yii2 implementation.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dmitriy Konev

27/09 2016

v1.0.1

1.0.1.0

Library for create and write sitemap.xml for you site. Yii2 implementation.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dmitriy Konev

27/09 2016

v1.0

1.0.0.0

Library for create and write sitemap.xml for you site. Yii2 implementation.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dmitriy Konev