How would i properly sort output of a MVClister?
<?php
class page_index extends Page {
function init(){
parent::init();
$p=$this;
$this->add('MVCLister',null,'News','News')->setModel('News');
$this->add('MVCLister',null,'Links','Links')->setModel('Links');
}
function defaultTemplate(){
return array('page/home'); // separate pages from views to avoid mess in templates
}
}
You can order either through model or by using lister’s dq property. Model ordering would be a more global decision such as News probably should be ordered within the model:
If it is a user-interface condition, such as a link passed through GET, then you should apply order directly on MVCLister: