Yii 1.1: listorderbehavior

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

...overview of the extension...


Yii 1.1 or above)


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.


github page

Be the first person to leave a comment

Please to leave your comment.

Create extension
No downloadable files yet