Пример #1
0
 /**   
  * Активация ссылок 
  *
  * @param string $returnUrl
  * @param string $activeCss
  *
  * @return string
  */
 public function activeLink($returnUrl, $activeCss = 'class="active"')
 {
     $current = strtolower($this->request->getController() . '/' . $this->request->getAction());
     if ($current === $returnUrl) {
         return $activeCss;
     }
     preg_match('#(.+?)/<(.*?)>#', $returnUrl, $out);
     if (!empty($out)) {
         $check = explode('|', $out[2]);
         foreach ($check as $action) {
             if ($current === $out[1] . '/' . $action) {
                 return $activeCss;
             }
         }
     }
     return null;
 }
Пример #2
0
 /**
  * Конструктор
  *
  * @param object $router
  */
 public function __construct($router)
 {
     parent::__construct($router);
 }
Пример #3
0
 /**
  * Возвращает имя вызванного экшена
  *
  * @return string
  */
 public function getAction()
 {
     $action = $this->request->getAction();
     $action = preg_replace('#[^a-z0-9\\-_]#ui', '', $action);
     return 'action' . mb_convert_case($action, MB_CASE_TITLE);
 }