/** * {@inheritdoc} */ public function accept() { if (!isset($this->options['access']) or !$this->options['access']) { return true; } return $this['user']->hasAccess(parent::current()->getAccess()); }
/** * {@inheritdoc} */ public function accept() { $item = parent::current(); if ($active = $item->getAttribute('active') and is_string($active)) { $active = (bool) preg_match('#^' . str_replace('*', '.*', $active) . '$#', $this->route); $item->setAttribute('active', $active); if ($active) { while ($item->getParentId() && ($item = $item->getMenu()->getItem($item->getParentId()))) { $item->setAttribute('active', $active); } } } return true; }