title = $title; $this->url = $url; if (isset($options['icon'])) { $this->icon = $options['icon']; } if (isset($options['i18n'])) { $this->i18n = $options['i18n']; } if (isset($options['children'])) { $this->children = $options['children']; } } /** * Zwraca adres url elementu menu * * @return string */ public function getUrl() { return $this->url; } public function getIcon() { return $this->icon; } /** * Zwraca tytuł elementu menu * * @return string */ public function getTitle() { return $this->title; } /** * Zwraca nazwę katalogu i18n elementu menu * * @return string */ public function getI18n() { return $this->i18n; } /** * Zwraca tablicę zawierającą elementy menu podrzędnego * * @return stNavigationMenuItem[] */ public function getItems() { return $this->children; } /** * Dodaje elementu menu * * @param string $id Unikalne id elementu * @param string $title Tytuł elementu * @param string $url Url elementu * @param array $options Dodatkowe opcje elementu (icon, i18n, children) * @return stNavigationMenuItem Instancja dodanego elementu */ public function addItem($id, $title, $url = null, array $options = array()) { $item = new stNavigationMenuItem($title, $url, $options); $this->children[$id] = $item; return $item; } }