public function addOption($name, $value = null) { $option = new Dropdown_Option($name, $value); $option->setForm($this->getForm()); $this->options[] = $option; return $this; }
/** * Add a new option to this dropdown. * * @param string $name * @param string $value * @param string $tooltip (optional) * @param Object $readonlyLink (optional) in case the dropdown is rendered in * readonly mode, this link will shown. The text for this link will be * set as $name. If not set, the $name will be shown. * @return Dropdown */ public function addOption($name, $value = null, $tooltip = null, $readonlyLink = null) { $option = new Dropdown_Option($name, $value, $readonlyLink); if ($tooltip) { $option->set("title", $tooltip); } $option->setForm($this->getForm()); $this->options[] = $option; return $this; }