Пример #1
0
 /**
  * Updates the SEO page values for given page instance
  *
  * @param PageInterface $page
  */
 protected function updateSeoPage(PageInterface $page)
 {
     if (!$this->seoPage) {
         return;
     }
     if (!$this->seoPage->getTitle() || $this->seoPage->getTitle() == $this->seoPageTitle) {
         $browserTitle = $page->getTitle() ?: $page->getName();
         $this->seoPage->addTitle($browserTitle);
     }
     if ($page->getMetaDescription()) {
         $this->seoPage->addMeta('name', 'description', $page->getMetaDescription());
     }
     if ($page->getMetaKeyword()) {
         $this->seoPage->addMeta('name', 'keywords', $page->getMetaKeyword());
     }
     $this->seoPage->addMeta('property', 'og:type', 'article');
     $this->seoPage->addHtmlAttributes('prefix', 'og: http://ogp.me/ns#');
 }
Пример #2
0
 /**
  * @return string
  */
 public function getTitle()
 {
     return sprintf('<title>%s</title>', strip_tags($this->page->getTitle()));
 }