Example #1
0
 protected function init()
 {
     $class = isset($this->_model) ? $this->_model->getShortClassName() : $this->_attr;
     if (isset($_FILES[$class])) {
         foreach ($_FILES[$class] as $key => $value) {
             $key = '_' . $key;
             $this->{$key} = isset($this->_model) ? $value[$this->_attr] : $value;
         }
     }
 }
Example #2
0
 /**
  * @param Model $model
  * @param string $attr
  * @return string
  */
 function invalidText($model, $attr)
 {
     return _('Invalid filed') . ' ' . _($model->getAttributeCaption($attr));
 }