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...


Yii 1.1 or above)


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

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

public function behaviors(){
    return [
        'ListOrderBehavior' => [
            'class' => '',
            '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.


github page

2 0
1 follower
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