01.
<?php
02.
class
Chapter5Controller
extends
Controller{
03.
function
actionCGridView(){
04.
$model
=
new
Book();
05.
$books
=
new
CActiveDataProvider(
$model
);
06.
07.
$this
->render(
"CGridView"
,
array
(
08.
"books"
=>
$books
09.
));
10.
}
11.
function
actionCListView(){
12.
$model
=
new
Book();
13.
$books
=
new
CActiveDataProvider(
$model
);
14.
15.
$this
->render(
"CListView"
,
array
(
16.
"books"
=>
$books
17.
));
18.
}
19.
}
20.
?>