uri = $uri; return $this; } /** * Returns URI * * @return string */ public function getUri() { return $this->uri; } /** * Returns href for this page * * Includes the fragment identifier if it is set. * * @return string */ public function getHref() { $uri = $this->getUri(); $fragment = $this->getFragment(); if (null !== $fragment) { if ('#' == substr($uri, -1)) { return $uri . $fragment; } else { return $uri . '#' . $fragment; } } return $uri; } /** * Returns an array representation of the page * * @return array */ public function toArray() { return array_merge( parent::toArray(), array( 'uri' => $this->getUri(), ) ); } }