PHP code example of nepttune / sitemap
1. Go to this page and download the library: Download nepttune/sitemap library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
nepttune / sitemap example snippets
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();
}
}