listorderbehavior it will automaticly take care about any model list_order (display_order, etc) fields

  1. Requirements
  2. Usage
  3. Resources

...overview of the extension...

Requirements

Yii 1.1 or above)

Usage

Download extension from github and place it to Your behavior folder in protected folder.

.....how to use this extension...

In model class that You want to use this behavior add :

public function behaviors(){
    return [
        'ListOrderBehavior' => [
            'class' => 'path.to.ListOrderBehavior',
            'listOrderAttribute' => 'list_order_attributeName', 
             // example 'list_order'
            'filterAttributes' => 'filter attribute names COMMA separated',
            // example 'type, user_id'
        ];
    ];
}

Property 'listOrderAttribute' should hold actual DB field name that is used for order (list_order, display_order etc).

Property 'filterAttributes' is string containing other attributes that should be used for filter, COMMA separated. For example if You have field 'type' that can be different for some records and You want to separate 'list_order' by 'type', add 'type' in to 'filterAttributes' and You will have order attribute separated by type.

Meaning You can have same list_order value for different model types.

Resources

github page

2 0
1 follower
0 downloads
Yii Version: 1.1
License: Apache-2.0
Category: Database
Developed by: dragan.zivkovic
Created on: Oct 14, 2014
Last updated: 9 years ago

Related Extensions