예제 #1
0
파일: Field.php 프로젝트: jivoo/jivoo
 /**
  * Cosntruct form field.
  * @param FormHelper $Form Form helper.
  * @param string $field Field name.
  */
 public function __construct(FormHelper $Form, $field)
 {
     parent::__construct('div');
     $this->Form = $Form;
     $this->field = $field;
     $this->addClass('field');
     if ($Form->isInvalid($field)) {
         $this->addClass('field-error');
     }
     if ($Form->isRequired($field)) {
         $this->addClass('field-required');
     }
 }