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' => $this->builder->conf('active_class')), $this->attributes);
        $this->isActive = true;

        return $this;
    }
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' => $this->builder->conf('active_class')), $this->attributes);
        $this->isActive = true;

        return $this;
    }
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' => $ this -> builder -> conf ( 'active_class' ) ) , $ this -> attributes ) ; $ this -> isActive = true ; return $ this ; }
Make the item active.

@param null|string $pattern
@return Item
Make the item active .