yiicod/yii2-base

The base behaviors, helpers, etc. for the Yii2 framework

Installs: 23 569

Dependents: 8

Suggesters: 0

Security: 0

Stars: 4

Watchers: 2

Forks: 0

Open Issues: 0

Type:yii2-extension

1.0.7 2018-09-04 08:59 UTC

This package is auto-updated.

Last update: 2024-10-27 00:38:23 UTC


README

Latest Stable Version Total Downloads Scrutinizer Code QualityCode Climate

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