sem-soft/yii2-behaviors

Set of additional behaviors and filters for Yii2 Framework

Installs: 1 190

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Type:yii2-behaviors

1.0.5 2018-04-23 15:19 UTC

This package is auto-updated.

Last update: 2024-04-07 07:10:48 UTC


README

Install by composer

composer require sem-soft/yii2-behaviors

Or add this code into require section of your composer.json and then call composer update in console

"sem-soft/yii2-behaviors": "*"

Usage

// Model behaviors
  public function behaviors()
  {
    return[
      // Удаляем "точку" перед валидацией
      [
        'class' =>  TrimmerBehavior::className(),
        'attributes'  =>  ['sitemap_priority'],
        'characterMask' =>  '.'
      ]
    ];
	}
  
  // Controller filters
  public function behaviors()
  {
    return [
        // Действие hint запрашивается только AJAX-ом
        'ajax'  =>  [
          'class' => AjaxFilter::className(),
          'actions' => ['hint'],
        ],
    ];
  }