Yii CActiveDataProvider Usage Examples

Yii CActiveDataProvider Usage Examples

Last updated:
  • simplest case

    $dp = new CActiveDataProvider('User');
    
  • with a simple criteria

    $dp = new CActiveDataProvider('User',[
        'criteria'=>[
            'condition'=>"name='john'"
    ]]);
    
  • with pagination

    $dp = new CActiveDataProvider('User',[
        'pagination'=>[
            'pageSize'=>20
    ]]);