Menu\Items\Item::hasActivePatterns PHP Method

hasActivePatterns() protected method

Check if this item has an active pattern
protected hasActivePatterns ( ) : boolean
return boolean
    protected function hasActivePatterns()
    {
        foreach ($this->patterns as $pattern) {
            $path = $this->getRequest()->getPathInfo();
            if (is_array($pattern)) {
                foreach ($pattern as $p) {
                    $isActive = preg_match('/' . $p . '/i', $path);
                }
            } else {
                $isActive = preg_match('/' . $pattern . '/i', $path);
            }
            if ($isActive) {
                return true;
            }
        }
        return false;
    }