yiicod / yii2-base
The base behaviors, helpers, etc. for the Yii2 framework
Installs: 23 623
Dependents: 8
Suggesters: 0
Security: 0
Stars: 4
Watchers: 2
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- yiisoft/yii2: 2.*
README
Installation
Either run
php composer.phar require --prefer-dist yiicod/yii2-base "*"
or add
"yiicod/yii2-base": "*"
Usage action
- yiicod\base\actions\base\Action. Methods: performAjaxValidation, loadModel
Usage model
/** * Attributes mapper(Dynamic attr by mapping). * yiicod\base\models\behaviors\AttributesMapBehavior * $model->title // But in db it can be title_ext * $model->alias // But in db it can be slug */ [ 'class' => 'yiicod\base\models\behaviors\AttributesMapBehavior', 'attributesMap' => [ 'fieldTitle' => 'title_ext', 'fieldAlias' => 'slug', ] ], /** * HTMLPurify */ [ 'class' => 'yiicod\base\models\behaviors\XssBehavior', ]
Usage Enum
- Abstract class Enumerable for enum