A question about list_items in the simple model tutorial
Hello,
I am trying to follow the tutorial for creating a simple module.
I don't understand everything in the function list_items.
In the line: $data = parent::list_items($limit, $offset, $col, $order)
What does parent::list_items($limit, $offset, $col, $order) do?
And what does this comment mean: "Although we show default $col and $order values, those need to be set on the module to properly sort the list items."
As far as I understand the default $col is 'name' and the default $order is 'asc' so where do we set them on the module?
what?
Thank you
Comments
'default_col' => 'location', 'default_order' => 'asc',
I have downloaded the example files and looking at the My_fuel_modules file
I don't see that the default_col and default_order are set.
The file has only these lines:
$config['modules']['authors'] = array();
$config['modules']['articles'] = array();
$config['modules']['categories'] = array();
So does that mean the module won't sort the items properly? Quote: "those need to be set on the module to properly sort the list items."
The default values can be seen here: http://www.getfuelcms.com/user_guide/modules/simple
You'll see the default_col defaults to:
The default is the second column of the table (e.g. the one normally after the id column)