2017-25 © Pedro Peláez
 

library sitemap

Sitemap generator component

image

nepttune/sitemap

Sitemap generator component

  • Thursday, April 26, 2018
  • by peldax
  • Repository
  • 1 Watchers
  • 0 Stars
  • 9 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 9 Versions
  • 13 % Grown

The README.md

Sitemap

:wrench: Sitemap generator component, (*1)

Introduction

This componenet automaticaly generates sitemap from annotated presenter actions. Found actions are cached to improve performance., (*2)

Installation

Install package using composer, (*3)

composer require nepttune/sitemap

Dependencies

How to use

  • Implement \Nepttune\TI\ISitemap interface and use \Nepttune\TI\TSitemap trait in selected presenters (Those which should have links in sitemap.).
  • Add annotation @sitemap to selected actions.
  • Register \Nepttune\Component\ISitemapFactory as service in cofiguration file.
  • Inject it into eg. SitemapPresenter, write createComponent method and use macro {control} in template file.
    • Just as any other component.
    • Content type is automaticaly set to application/xml.

Example configuration

services:
    - Nepttune\Component\ISitemapFactory

You can optionaly provide configuration array and enable hreflang links to be included for each entry (Requires translator in presenter)., (*4)

parameters:
    sitemap:
        hreflang: true

services:
    sitemapFactory:
            implement: Nepttune\Component\ISitemapFactory
            arguments:
                - '%sitemap%'

Example presenter

class ExamplePresenter implements IPresenter, ISitemap
{
    use TSitemap;

    /** @var  \Nepttune\Component\ISitemapFactory */
    protected $iSitemapFactory;

    public function __construct(\Nepttune\Component\ISitemapFactory $ISitemapFactory)
    {
        $this->iSitemapFactory = $ISitemapFactory;
    }

    public function actionSitemap()
    {
        $this->getHttpResponse()->setContentType('application/xml');
    }

    /**
     * @sitemap
     */
    public function actionExample()
    {
    }

    protected function createComponentSitemap()
    {
        return $this->iSitemapFactory->create();
    }
}

The Versions

26/04 2018

dev-master

9999999-dev https://www.peldax.com

Sitemap generator component

  Sources   Download

MIT

The Requires

 

26/04 2018

v1.1.4

1.1.4.0 https://www.peldax.com

Sitemap generator component

  Sources   Download

MIT

The Requires

 

25/04 2018

v1.1.3

1.1.3.0 https://www.peldax.com

Sitemap generator component

  Sources   Download

MIT

The Requires

 

23/04 2018

v1.1.2

1.1.2.0 https://www.peldax.com

Sitemap generator component

  Sources   Download

MIT

The Requires

 

18/04 2018

v1.1.1

1.1.1.0 https://www.peldax.com

Sitemap generator component

  Sources   Download

MIT

The Requires

 

18/04 2018

v1.1

1.1.0.0 https://www.peldax.com

Sitemap generator component

  Sources   Download

MIT

The Requires

 

18/04 2018

v1.0.2

1.0.2.0 https://www.peldax.com

Sitemap generator component

  Sources   Download

MIT

The Requires

 

17/04 2018

v1.0.1

1.0.1.0 https://www.peldax.com

Sitemap generator component

  Sources   Download

MIT

The Requires

 

17/04 2018

v1.0

1.0.0.0 https://www.peldax.com

Sitemap generator component

  Sources   Download

MIT

The Requires