I have a variable which is not a field variable in table. I declare it in model. But validation is not happening on the client, though I am using core validator.
class Breakdown extends \yii\db\ActiveRecord
{
public $enos_id;
/**
* @inheritdoc
*/
public static function tableName()
{
return 'breakdown';
}
/**
* @inheritdoc
*/
public function rules()
{
return [
[['enos_id'], 'integer', 'min' => 1, 'max'=>99, ],
.........
];
}
/**
* @inheritdoc
*/
public function attributeLabels()
{
....
}
}
enos_id is the variable which is getting input from the form but I am unable to get it validated on client side.