inspirenmy / yii2-models
Yii2 models library
Installs: 948
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 1
Type:yii2-extension
Requires
- php: >5.5.0
- inspirenmy/yii2-behaviors: *
- inspirenmy/yii2-traits: *
- yiisoft/yii2: ~2.0.0
This package is not auto-updated.
Last update: 2024-11-10 04:17:29 UTC
README
#Yii2 models library ##Description Yii2 models library which used in web-application development.
##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.
#####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).
So sanitize rule can inherits by any form.
#####Usage:
in model
class AnyForm extends \inspirenmy\models\Model {...}
in controller use ajax validation
if (!is_null($validate = $model->performAjaxValidation())) return $validate;