Sample using CActiveDataProvider
Sample 1:
[php]
$dataProvider=new CActiveDataProvider(‘User’,array(
‘criteria’=>array(
‘condition’=>’activationstatus = 1’),
));
[/php]
Sample 2:
[php]
$dataProvider=new CActiveDataProvider(‘Event’, array(
‘criteria’=>array(
‘condition’=>’date >= "’.date(‘Y-m-d’, strtotime(‘-2 years’)).’"’,
),
));
[/php]
Sample 3:
[php]
$dataProvider=new CActiveDataProvider(‘Post’, array(
‘pagination’=>array(
‘pageSize’=>5,
),
‘criteria’=>$criteria,
));
[/php]
Sample 4:
[php]
$dataProvider=new CActiveDataProvider(‘User’)
[/php]
Leave a Reply