Download the PHP package jeanvaljean/active-behavior without Composer
On this page you can find all versions of the php package jeanvaljean/active-behavior. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jeanvaljean/active-behavior
More information about jeanvaljean/active-behavior
Files in jeanvaljean/active-behavior
Package active-behavior
Short Description Active plugin for CakePHP
License MIT
Homepage https://github.com/JeanValJeann/cakephp-active-behavior
Informations about the package active-behavior
CakePHP 3.6+ Active Behavior
A plugin to manage an active column
This plugin is for CakePHP 3.6+.
Setup
Usage
Make sure the table that you want for using the active plugin has a column to store the active state of an entity. According to the pluging default configuration this column has to be named "active" and has to be:
Note : If you want to use an other column to store the active state of an entity, you can do it, you just have to mention it into pluing configuration using "active_field".
Add the Active behavior in initialize()
method of your table:
Now the active behavior is available on this table class.
Configuration
The behavior configuration allow you to mention :
- active_field : the table's field you want for storing the active state of an entity
- group : the table's field you want to use for grouping the active behavior on specific entities
- keep_active : to make sure that always one entity is active
- multiple : to authorize several entities to be active
The default plugin configuration is as below :