/** * 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); }
public function getLabelPart($key) { return parent::getLabel($this->items[$key])->for($this->getHtmlId() . '-' . $key); }
/** * @return Html */ public function getLabelPart($key = NULL) { return func_num_args() ? parent::getLabel($this->items[$key])->for($this->getHtmlId() . '-' . $key) : $this->getLabel(); }
protected function validate() { $this->mapper->runValidation(function (ValidatorInterface $validatorInterface) { return $validatorInterface->validatePropertyValue($this->wrappedEntity->getEntity(), $this->component->name, $this->collection); }, $this->component instanceof BaseControl ? $this->component : $this->component->getForm()); }