Exemplo n.º 1
0
 public function getWrapperClass()
 {
     $type = get_class($this);
     $pos = strrpos($type, '\\');
     if ($pos !== false) {
         $type = substr($type, $pos + 1);
     }
     return trim('form-entity form-field form-field-' . strtolower($type) . ' ' . ($this->getRequired() ? 'form-required ' : '') . ($this->hasErrors() ? 'form-errors ' : '') . parent::getWrapperClass());
 }
Exemplo n.º 2
0
 public function renderNormal(Entity $entity)
 {
     $markup = "";
     foreach ($entity as $columnEntity) {
         if (!$entity instanceof Container) {
             throw new \Exception('CollectionTabular requires entities to be subclass of \\Curry\\Form\\Container');
         }
         $attr = array('class' => $columnEntity->getWrapperClass());
         $markup .= Entity::html('td', $attr, $columnEntity->render());
     }
     $attr = array('class' => $entity->getWrapperClass());
     return Entity::html('tr', $attr, $markup);
 }
Exemplo n.º 3
0
 public function renderNormal(Entity $entity)
 {
     $attr = array('class' => $entity->getWrapperClass());
     return Entity::html('tr', $attr, Entity::html('td', array(), $entity->isLabelOutside() ? $entity->renderLabel() : ' ') . Entity::html('td', array(), $entity->render() . $entity->renderDescription() . $entity->renderErrors()));
 }
Exemplo n.º 4
0
 public function renderNormal(Entity $entity)
 {
     $attr = array('id' => $entity->getId() . '-label', 'class' => $entity->getWrapperClass());
     return Entity::html('dt', $attr, $entity->isLabelOutside() ? $entity->renderLabel() : '') . Entity::html('dd', array('id' => $entity->getId() . '-element'), $entity->render() . $entity->renderDescription() . $entity->renderErrors());
 }
Exemplo n.º 5
0
 public function renderNormal(Entity $entity)
 {
     $attr = array('class' => $entity->getWrapperClass());
     $markup = ($entity->isLabelOutside() ? $entity->renderLabel() : '') . $entity->render() . $entity->renderDescription() . $entity->renderErrors();
     return Entity::html('div', $attr, $markup);
 }