/** * @inheritdoc */ public function render($localValue, $data) { $params = ["type" => $this->inputType, "name" => $this->getName(true)]; if (is_array($localValue) && isset($localValue[$this->getName()])) { $params["value"] = $localValue[$this->getName()]; } $render = new Tag("input", $this->overridesParamsBeforeRender($params, [], $localValue, $data), true); return $render->draw([], null); }
public function render($value) { $tag = new Tag('optgroup'); $params = ['label' => $this->getLabel()]; $optionsRender = ''; foreach ($this->getOptions() as $option) { $optionsRender .= $option->render($value); } return $tag->draw($params, $optionsRender); }
public function render($value, $data) { $params = ["name" => $this->getName(true)]; if (isset($value[$this->getName()])) { $value = $value[$this->getName()]; } else { $value = ""; } $render = new Tag("textarea", $params, false); return $render->draw([], $value); }
public function render($value, array $options = []) { $params = ['name' => $this->getName(true), 'id' => $this->getId()]; if (isset($value[$this->getName()])) { $value = $value[$this->getName()]; } else { $value = ''; } $render = new Tag('textarea', $params, false); return $render->draw([], $value); }
/** * @inheritdoc */ public function render($value) { $tag = new Tag('option'); $params = ['value' => $this->getValue()]; if ($this->enabled) { if (is_array($value) && in_array($this->getValue(), $value) || !is_array($value) && $value == $this->getValue()) { $params['selected'] = 'selected'; } } else { if ($this->enabled === false) { $params['disabled'] = 'disabled'; } } return $tag->draw($params, $this->getLabel()); }
public function render($value, $data) { $params = ["name" => $this->getName(true)]; if (isset($value[$this->getName()])) { $value = $value[$this->getName()]; } else { $value = null; } $render = new Tag("select", $params, false); $options = ""; foreach ($this->rootGroup->getOptions() as $v) { $options .= $v->render($value); } return $render->draw([], $options); }
/** * @inheritdoc */ public function render($value) { $tag = new Tag("option"); $params = ["value" => $this->getValue()]; if ($this->enabled) { if (is_array($value) && in_array($this->getValue(), $value) || !is_array($value) && $value == $this->getValue()) { $params["selected"] = "selected"; } } else { if ($this->enabled === false) { $params["disabled"] = "disabled"; } } return $tag->draw($params, $this->getLabel()); }
public function render($value, array $options = []) { $params = ['id' => $this->getId(), 'name' => $this->getName(true)]; if (isset($options['class'])) { $params['class'] = $options['class']; } if (isset($value[$this->getName()])) { $value = $value[$this->getName()]; } else { $value = null; } $render = new Tag('select', $params, false); $selectOptions = ''; foreach ($this->rootGroup->getOptions() as $v) { $selectOptions .= $v->render($value); } return $render->draw([], $selectOptions); }
/** * @inheritdoc */ public function render($localValue, array $options = []) { $params = ['type' => $this->inputType, 'name' => $this->getName(true), 'id' => $this->getId()]; foreach ($this->getAttributes() as $attrName => $attrValue) { $params[$attrName] = $attrValue; } if (isset($options['attributes']) && is_array($options['attributes'])) { foreach ($options['attributes'] as $attrName => $attrValue) { $params[$attrName] = $attrValue; } } if (isset($options['class'])) { $params['class'] = $options['class']; } if (is_array($localValue) && isset($localValue[$this->getName()])) { $params['value'] = (string) $localValue[$this->getName()]; } $render = new Tag('input', $this->overridesParamsBeforeRender($params, $localValue), true); return $render->draw([], null); }