demmonico/yii2-models

Yii2 models library

Installs: 2 354

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 1

Open Issues: 0

Type:yii2-extension

v1.0.0 2016-08-22 16:36 UTC

This package is not auto-updated.

Last update: 2024-11-20 00:01:15 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/demmonico/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 \demmonico\models\ActiveRecord {...}

###Model Model model overload parent \yii\base\Model. This add features:

So sanitize rule can inherits by any form.

#####Usage:

in model

class AnyForm extends \demmonico\models\Model {...}

in controller use ajax validation

if (!is_null($validate = $model->performAjaxValidation()))
            return $validate;