예제 #1
0
파일: sitemap.php 프로젝트: difra-org/difra
 /**
  * This action handles rewrites from nginx for URLs like:
  * /sitemap.html
  * /sitemap-1.html
  * /sitemap-2.html
  * etc.
  *
  * @param \Difra\Param\AnyInt $page
  * @throws \Difra\View\HttpError
  */
 public function htmlAction(\Difra\Param\AnyInt $page = null)
 {
     $this->cache = self::CACHE_TTL;
     if (!($html = \Difra\Libs\XML\Sitemap::getHTML($page))) {
         throw new \Difra\View\HttpError(404);
     }
     $this->outputType = 'text/html';
     $this->output = $html;
 }
예제 #2
0
파일: sape.php 프로젝트: difra-org/difra
 public static function addSitemapHTML()
 {
     $html = \Difra\Libs\XML\Sitemap::getXMLforHTML();
     if (!$html) {
         return;
     }
     $controller = \Difra\Envi\Action::getController();
     $sitemapNode = $controller->realRoot->appendChild($controller->xml->createElement('sitemap'));
     $sitemapNode->setAttribute('html', $html);
 }