public function run() { $request = Yii::app()->request; $model = new EavAttributeExtended(); $formName = get_class($model); $validator = new BaseValidatorForm(); $validator->setAttribute($model); if (is_null($request->getPost($formName))) { $this->controller->render('create', array('model' => $model, 'validator' => $validator)); Yii::app()->end(); } $validator->setValidatorInputs($_POST); $attributes = $request->getPost($formName); $model->attributes = $attributes; $model->setRules($validator->getRules()); $model->setValues($attributes['values']); if ($model->validate() && empty($model->validatorErrors)) { $model->assignPossibleValues(); if ($model->save(false)) { Yii::app()->getComponent('user')->setFlash('success', Yii::t('EavModule.eavactiverecord', 'The attribute has been successfully saved')); $this->controller->redirect(array('attribute/index')); } } Yii::app()->getComponent('user')->setFlash('error', Yii::t('EavModule.eavactiverecord', 'A validation error has occurred while processing your request')); $this->controller->render('create', array('model' => $model, 'validator' => $validator)); }
public function attributeLabels() { return array_merge(parent::attributeLabels(), array('filter' => Yii::t('EavModule.eavactiverecord', 'Callback name'))); }
public function attributeLabels() { return array_merge(parent::attributeLabels(), array('allowEmpty' => Yii::t('EavModule.eavactiverecord', 'Allow empty value'), 'encoding' => Yii::t('EavModule.eavactiverecord', 'Encoding'), 'is' => Yii::t('EavModule.eavactiverecord', 'The exact length'), 'max' => Yii::t('EavModule.eavactiverecord', 'The maximum length'), 'min' => Yii::t('EavModule.eavactiverecord', 'The minimum length'), 'tooShort' => Yii::t('EavModule.eavactiverecord', 'The error message used when the value is too short'), 'tooLong' => Yii::t('EavModule.eavactiverecord', 'The error message used when the value is too long'))); }
public function attributeLabels() { return array_merge(parent::attributeLabels(), array('allowEmpty' => Yii::t('EavModule.eavactiverecord', 'Allow empty value'), 'format' => Yii::t('EavModule.eavactiverecord', 'The date format pattern'), 'timestampAttribute' => Yii::t('EavModule.eavactiverecord', 'The timestamp attribute name'))); }
public function attributeLabels() { return array_merge(parent::attributeLabels(), array('setOnEmpty' => Yii::t('EavModule.eavactiverecord', 'Set default value only when an attribute is empty'), 'value' => Yii::t('EavModule.eavactiverecord', 'Default value'))); }
public function attributeLabels() { return array_merge(parent::attributeLabels(), array('requiredValue' => Yii::t('EavModule.eavactiverecord', 'Required value'), 'strict' => Yii::t('EavModule.eavactiverecord', 'Strict comparison'), 'trim' => Yii::t('EavModule.eavactiverecord', 'Value trimming'))); }
public function attributeLabels() { return array_merge(parent::attributeLabels(), array('allowEmpty' => Yii::t('EavModule.eavactiverecord', 'Allow empty value'), 'attributeName' => Yii::t('EavModule.eavactiverecord', 'The attribute name'), 'caseSensitive' => Yii::t('EavModule.eavactiverecord', 'Case-sensitive'), 'className' => Yii::t('EavModule.eavactiverecord', 'The class name'), 'criteria' => Yii::t('EavModule.eavactiverecord', 'The additional query criteria'))); }
public function attributeLabels() { return array_merge(parent::attributeLabels(), array('allowEmpty' => Yii::t('EavModule.eavactiverecord', 'Allow empty value'), 'not' => Yii::t('EavModule.eavactiverecord', 'Inversion of the validation logic'), 'strict' => Yii::t('EavModule.eavactiverecord', 'Strict comparison'), 'range' => Yii::t('EavModule.eavactiverecord', 'The list of valid values'))); }
public function attributeLabels() { return array_merge(parent::attributeLabels(), array('allowEmpty' => Yii::t('EavModule.eavactiverecord', 'Allow empty value'), 'compareAttribute' => Yii::t('EavModule.eavactiverecord', 'The name of the attribute to be compared with'), 'compareValue' => Yii::t('EavModule.eavactiverecord', 'The constant value to be compared with'), 'operator' => Yii::t('EavModule.eavactiverecord', 'The operator used for comparison'), 'strict' => Yii::t('EavModule.eavactiverecord', 'Strict comparison'))); }
public function attributeLabels() { return array_merge(parent::attributeLabels(), array('allowEmpty' => Yii::t('EavModule.eavactiverecord', 'Allow empty value'), 'defaultScheme' => Yii::t('EavModule.eavactiverecord', 'Default URI scheme'), 'pattern' => Yii::t('EavModule.eavactiverecord', 'Pattern'), 'validSchemes' => Yii::t('EavModule.eavactiverecord', 'Valid URI schemes'), 'validateIDN' => Yii::t('EavModule.eavactiverecord', 'Internationalized domain names'))); }
public function attributeLabels() { return array_merge(parent::attributeLabels(), array('allowEmpty' => Yii::t('EavModule.eavactiverecord', 'Allow empty value'), 'integerOnly' => Yii::t('EavModule.eavactiverecord', 'The attribute value can only be an integer'), 'integerPattern' => Yii::t('EavModule.eavactiverecord', 'The regular expression for matching integers'), 'max' => Yii::t('EavModule.eavactiverecord', 'The upper limit of the number'), 'min' => Yii::t('EavModule.eavactiverecord', 'The lower limit of the number'), 'numberPattern' => Yii::t('EavModule.eavactiverecord', 'The regular expression for matching numbers'), 'tooBig' => Yii::t('EavModule.eavactiverecord', 'The error message used when the value is too big'), 'tooSmall' => Yii::t('EavModule.eavactiverecord', 'The error message used when the value is too small'))); }
public function attributeLabels() { return array_merge(parent::attributeLabels(), array('allowEmpty' => Yii::t('EavModule.eavactiverecord', 'Allow empty value'), 'strict' => Yii::t('EavModule.eavactiverecord', 'Strict comparison'), 'falseValue' => Yii::t('EavModule.eavactiverecord', 'The value representing false status'), 'trueValue' => Yii::t('EavModule.eavactiverecord', 'The value representing true status'))); }
public function attributeLabels() { return array_merge(parent::attributeLabels(), array('allowEmpty' => Yii::t('EavModule.eavactiverecord', 'Allow empty value'), 'not' => Yii::t('EavModule.eavactiverecord', 'Inversion of the validation logic'), 'pattern' => Yii::t('EavModule.eavactiverecord', 'Pattern'))); }
public function attributeLabels() { return array_merge(parent::attributeLabels(), array('max' => Yii::t('EavModule.eavactiverecord', 'Maximum number of values'), 'min' => Yii::t('EavModule.eavactiverecord', 'Minimum number of values'), 'tooMany' => Yii::t('EavModule.eavactiverecord', 'The error message used when the attribute contains more values than allowed'), 'tooLittle' => Yii::t('EavModule.eavactiverecord', 'The error message used when the attribute contains not enough number of values'))); }
public function attributeLabels() { return array_merge(parent::attributeLabels(), array('allowEmpty' => Yii::t('EavModule.eavactiverecord', 'Allow empty value'), 'allowName' => Yii::t('EavModule.eavactiverecord', "Include the sender's name in the email"), 'checkMX' => Yii::t('EavModule.eavactiverecord', 'Check MX records'), 'checkPort' => Yii::t('EavModule.eavactiverecord', 'Check SMTP port'), 'fullPattern' => Yii::t('EavModule.eavactiverecord', 'The regular expression used to validate email addresses with the name part'), 'pattern' => Yii::t('EavModule.eavactiverecord', 'Pattern'), 'validateIDN' => Yii::t('EavModule.eavactiverecord', 'Internationalized domain names'))); }