in actionIndex I oredered elements modifying the method using CActiveDataProvider in this way:
public function actionIndex()
{
$dataProvider=new CActiveDataProvider('Articoli', array(
'criteria'=>array(
'order'=>'id DESC' //'order'=>'data DESC'
),
));
$this->render('index',array(
'dataProvider'=>$dataProvider,
));
}
Now I have to accomplish the same ordering in actionAdmin but I have just the model class:
public function actionAdmin()
{
$model=new Articoli('search');
$model->unsetAttributes(); // clear any default values
if(isset($_GET['Articoli']))
$model->attributes=$_GET['Articoli'];
$this->render('admin',array(
'model'=>$model,
));
}
How can I order the model?
I thought I could use the array_reverse PHP function on GET but I don't know what's GET structure.
Anyway, is there any other way?
Thanks!

Help













