Пример #1
0
 public function getSeoMetas()
 {
     $metas = [];
     foreach ($this->getCalculatedSeo()->getMetas() as $type => $tag) {
         foreach ($tag as $key => $content) {
             $metas[] = sprintf('<meta %s="%s" content="%s">', $type, $key, SeoTools::normalize($content));
         }
     }
     return $metas;
 }
Пример #2
0
 public function calculateSeo(SeoEvent $event)
 {
     $seo = $event->getSeo();
     /*
      * Trim title
      */
     $title = SeoTools::plain($seo->getTitle(), $this->maxTitleLength);
     $seo->setTitle($title);
     /*
      * Trim meta description
      */
     if ($seo->hasMeta('name', 'description')) {
         $description = SeoTools::plain($seo->getMetas('name', 'description'), $this->maxDescriptionLength);
         $seo->addMetaName('description', $description);
     }
 }