Example #1
0
 /**
  * @return bool
  */
 public function newsRouteCheck()
 {
     $newsItem = $this->getCurrentNewsItem();
     if ($newsItem) {
         $slugTitle = $this->route->createSlug($newsItem->title);
         $fullSlug = "{$slugTitle}-" . $newsItem->id;
         if (ltrim($this->route->getAddionalUri(), '/') === $fullSlug) {
             return true;
         }
     }
     return false;
 }
Example #2
0
 /**
  * @return bool
  */
 public function newsRouteCheck()
 {
     $newsItem = $this->getCurrentNewsItem();
     if ($newsItem) {
         $slugTitle = $this->route->createSlug($newsItem->title);
         $fullSlug = "{$slugTitle}-" . $newsItem->id;
         if (ltrim($this->route->getAddionalURI(), '/') === $fullSlug) {
             return true;
         } elseif (!empty($fullSlug)) {
             $this->route->redirectToURL($this->route->getCurrentMenuItem()->getUrl($this->route, true) . $fullSlug);
         }
     }
     return false;
 }