예제 #1
0
 public function render(Entity $entity)
 {
     $datalist = '';
     if (count($this->datalist)) {
         foreach ($this->datalist as $value) {
             $datalist .= Entity::html('option', array('value' => $value));
         }
         $datalist = Entity::html('datalist', array('id' => $entity->getId() . '-datalist'), $datalist);
     }
     $attr = $this->attributes + array('type' => $this->type, 'id' => $entity->getId(), 'required' => $entity->getRequired(), 'name' => $entity->getFullName(), 'value' => $this->getValue($entity), 'list' => $datalist ? $entity->getId() . '-datalist' : null);
     return $datalist . Entity::html('input', $attr);
 }
예제 #2
0
 public function render(Entity $entity)
 {
     $attr = $this->attributes + array('type' => $this->type, 'id' => $entity->getId(), 'required' => $entity->getRequired(), 'name' => $entity->getFullName(), 'multiple' => $entity->isArray());
     return Entity::html('input', $attr);
 }
예제 #3
0
 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()));
 }