Skip to content

Set of additional behaviors and filters for Yii2 Framework

License

Notifications You must be signed in to change notification settings

sem-soft/yii2-behaviors

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Set of additional behaviors and filters for Yii2 Framework

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'],
        ],
    ];
  }

About

Set of additional behaviors and filters for Yii2 Framework

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages