How to get names in alphabetic order in Yii -


in yii web application, having student table saving student details. want student name in alphabetical order when retrieve data student table.

 public function defaultscope() {     return array("order" => "student_firstname"); } 

i tried function, not working properly.

please me.

thanks in advance.

you can use defaultorder property of csort. example...

$dataprovider=new cactivedataprovider('example', array(   'sort'=>array(     'defaultorder'=>array(       'student_firstname'=>false     )   ) ));