_uri; } /** * * get uri * * @return string */ public function getUri() { return $this->_uri; } /** * * set uri * * @param string $uri * @return \Cube\Navigation\Page\Uri * @throws \InvalidArgumentException */ public function setUri($uri) { if (!is_string($uri) && $uri !== null) { throw new \InvalidArgumentException(sprintf( "'uri' must be a string or null, %s given.", gettype($uri))); } $this->_uri = $uri; return $this; } /** * * check if a page is active, based on the request uri * * @param bool $recursive check in subpages as well, and if a subpage is active, return the current page as active * @return bool returns active status */ public function isActive($recursive = false) { if (!$this->_active) { $frontController = Front::getInstance(); $request = $frontController->getRequest(); if ($request->matchRequestUri($this->_uri, false)) { $this->_active = true; return true; } } return parent::isActive($recursive); } }