Yii Application Development Cookbook Second Edition by 2013

Yii Application Development Cookbook Second Edition by 2013

Author:2013
Language: eng
Format: epub
Publisher: Packt Publishing


Now run the grid/aR, grid/array, and grid/sql actions and try using the grids.

How it works...

The view is pretty simple and stays the same for all data providers. We are calling the grid widget and passing the data provider instance to it.

Let's review the actions one by one starting with actionAR:

$dataProvider = new CActiveDataProvider('Film', array( 'pagination'=>array( 'pageSize'=>10, ), 'sort'=>array( 'defaultOrder'=>array('title'=>false), ) ));

CActiveDataProvider works with AR models. The model class is passed as a first argument of the class constructor. The second argument is an array that defines class public properties. In the previous code, we are setting the pagination to 10 items per page and default sorting by title.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.