public function render(Entity $entity) { $value = $entity->getValue(); $attr = $this->attributes + array('type' => $this->type, 'id' => $entity->getId(), 'name' => $entity->getFullName()); if ($entity->isArray()) { $output = ""; foreach ($value as $v) { // TODO: does not preserve keys, is this ok? $output .= Entity::html('input', $attr + array('value' => $v)); } return $output; } return Entity::html('input', $attr + array('value' => $value)); }
public function render(Entity $entity) { $values = (array) $entity->getValue(); return $this->buildChoices($entity->getFullName(), $entity->getId(), $entity->getChoices(), $values, $entity->getDisabledChoices()); }
public function render(Entity $entity) { $attr = $this->attributes + array('type' => $this->type, 'id' => $entity->getId(), 'required' => $entity->getRequired(), 'name' => $entity->getFullName(), 'checked' => (bool) $entity->getValue()); return Entity::html('input', $attr); }
public function render(Entity $entity) { $attr = $this->attributes + array('id' => $entity->getId(), 'name' => $entity->getFullName(), 'required' => $entity->getRequired()); return Entity::html('textarea', $attr, htmlspecialchars($entity->getValue())); }
public function render(Entity $entity) { $attr = $this->attributes + array('id' => $entity->getId(), 'name' => $entity->getFullName()); return Entity::html('select', $attr, $this->buildChoices($this->getChoices(), (array) $entity->getValue(), $this->getDisabledChoices())); }