Example #1
0
 public function row(AbstractRow $row, $use_label = true)
 {
     $html = $row->input($this);
     if ($use_label) {
         $html = Html::label($row->getName(), $row->getLabel()) . $html;
     }
     if ($error = $row->getError($this)) {
         $html .= sprintf('<p>%s</p>', $error);
     }
     return Html::tag('div', $html);
 }
 public function row(AbstractRow $row, $use_label = true)
 {
     $html = $row->input($this);
     $error = $row->getError($this);
     if ($use_label) {
         $attr = $error ? array('class' => 'error') : array();
         $html = Html::label($row->getName(), $row->getLabel() . $html, $attr);
     }
     if ($error) {
         $html .= sprintf('<small class="error">%s</small>', $error);
     }
     return Html::tag('div', $html);
 }
 public function row(AbstractRow $row, $use_label = true)
 {
     $html = $row->input($this);
     if ($use_label) {
         $html = Html::label($row->getName(), $row->getLabel()) . $html;
     }
     $error = $row->getError($this);
     if ($error) {
         $html .= sprintf('<p class="help-block">%s</p>', $error);
         return Html::tag('div', $html, array('class' => 'form-group has-error'));
     }
     return Html::tag('div', $html, array('class' => 'form-group'));
 }
Example #4
0
 /**
  * Add a row to the Form.
  *
  * @param  AbstractRow $row The row
  * @return Form        This Form instance.
  */
 public function addRow(AbstractRow $row)
 {
     $this->rows[$row->getName()] = $row;
     return $this;
 }