Yii2 models library
Description
Yii2 models library which used in web-application development., (*1)
Composition
ActiveRecord
ActiveRecord model overload parent \yii\db\ActiveRecord
.
This add features:
- sanitize rules (see https://github.com/inspirenmy/yii2-behaviors)
- TimestampBehavior for autocomplete create and update date fields if they exists in any child model
- autocollect model saving errors at application logs., (*2)
Usage:
class AnyModel extends \inspirenmy\models\ActiveRecord {...}
Model
Model model overload parent \yii\base\Model
.
This add features:
- sanitize rules (see https://github.com/inspirenmy/yii2-behaviors)
- perform ajax validation method (see https://github.com/inspirenmy/yii2-traits)., (*3)
So sanitize rule can inherits by any form., (*4)
Usage:
in model, (*5)
class AnyForm extends \inspirenmy\models\Model {...}
in controller use ajax validation, (*6)
if (!is_null($validate = $model->performAjaxValidation()))
return $validate;