/** * Generates control's HTML element. * @return Nette\Utils\Html */ public function getControl() { $items = array(); foreach ($this->options as $key => $value) { $items[is_array($value) ? $this->translate($key) : $key] = $this->translate($value); } return Nette\Forms\Helpers::createSelectBox($items, array('selected?' => $this->value, 'disabled:' => is_array($this->disabled) ? $this->disabled : NULL))->addAttributes(parent::getControl()->attrs)->multiple(TRUE); }
/** * @return Html */ public function getControlPart($key) { $key = key(array((string) $key => NULL)); return parent::getControl()->addAttributes(array( 'id' => $this->getHtmlId() . '-' . $key, 'checked' => in_array($key, (array) $this->value, TRUE), 'disabled' => is_array($this->disabled) ? isset($this->disabled[$key]) : $this->disabled, 'required' => NULL, 'value' => $key, )); }
/** * @return Nette\Utils\Html */ public function getControlPart($key) { return parent::getControl()->addAttributes(array('id' => $this->getHtmlId() . '-' . $key, 'checked' => in_array($key, (array) $this->value), 'disabled' => is_array($this->disabled) ? isset($this->disabled[$key]) : $this->disabled, 'value' => $key)); }