...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.
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.