https://github.com/yiicod/yii2-base
https://github.com/yiicod/yii2-base
Last synced: 24 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/yiicod/yii2-base
- Owner: yiicod
- License: other
- Created: 2015-03-15T10:47:52.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2018-09-04T09:03:15.000Z (almost 7 years ago)
- Last Synced: 2025-04-13T15:12:43.462Z (3 months ago)
- Language: PHP
- Size: 15.6 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
The base library for extensions and apps
========================================[](https://packagist.org/packages/yiicod/yii2-base) [](https://packagist.org/packages/yiicod/yii2-base) [](https://scrutinizer-ci.com/g/yiicod/yii2-base/?branch=master)[](https://codeclimate.com/github/yiicod/yii2-base)
#### Installation
Either run```
php composer.phar require --prefer-dist yiicod/yii2-base "*"
```or add
```json
"yiicod/yii2-base": "*"
```
#### Usage action
- yiicod\base\actions\base\Action. Methods: performAjaxValidation, loadModel#### Usage model
```php
/**
* 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