Inheritance: extends BaseControl
Ejemplo n.º 1
0
 /**
  * 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);
 }
Ejemplo n.º 2
0
 public function getLabelPart($key)
 {
     return parent::getLabel($this->items[$key])->for($this->getHtmlId() . '-' . $key);
 }
Ejemplo n.º 3
0
 /**
  * @return Html
  */
 public function getLabelPart($key = NULL)
 {
     return func_num_args() ? parent::getLabel($this->items[$key])->for($this->getHtmlId() . '-' . $key) : $this->getLabel();
 }
Ejemplo n.º 4
0
 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());
 }