コード例 #1
0
ファイル: Item.php プロジェクト: R3alflash/BFAdminCP
 /**
  * Make the item active
  *
  * @return Lavary\Menu\Item
  */
 public function active($pattern = null)
 {
     if (!is_null($pattern)) {
         $pattern = ltrim(preg_replace('/\\/\\*/', '(/.*)?', $pattern), '/');
         if (preg_match("@^{$pattern}\\z@", \Request::path())) {
             $this->activate();
         }
         return $this;
     }
     $this->attributes['class'] = Builder::formatGroupClass(array('class' => 'active'), $this->attributes);
     return $this;
 }
コード例 #2
0
ファイル: Link.php プロジェクト: postalservice14/laravel-menu
 /**
  * Make the anchor active
  *
  * @return Lavary\Menu\Link
  */
 public function active()
 {
     $this->attributes['class'] = Builder::formatGroupClass(array('class' => 'active'), $this->attributes);
     return $this;
 }