Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

61 lines (51 sloc) 2.0 kb
<?php
$this->pageTitle = Yii::app()->name;
echo CHtml::tag('p',array(),'The Grid View below lists all invoice lines of the database. All fields are searcheable, and can be sorted.');
echo CHtml::tag('p',array(),'The implementation is very easy with '
.CHtml::link('RelatedSearchBehavior','http://www.yiiframework.com/extension/relatedsearchbehavior/')
.'. Check out the \'Invoiceline\' model to see how it is done.');
echo CHtml::tag('p',array(),'The database is open source from '.CHtml::link('http://chinookdatabase.codeplex.com','http://chinookdatabase.codeplex.com')." The schema is shown further below. ");
$model=new Invoiceline('search');
if(isset($_GET['Invoiceline'])) {
$model->attributes=$_GET['Invoiceline'];
}
$dataProvider=$model->search();
if($dataProvider instanceof KeenActiveDataProvider) {
/* @var $dataProvider KeenActiveDataProvider */
$dataProvider->withKeenLoading=array(
'track',
'track.album',
'track.album.artist',
'track.mediatype',
'invoice.customer',
'invoice',
'invoice.customer.support',
'track.genre',
);
}
$dataProvider->pagination=array('pageSize'=>4,);
$this->widget('zii.widgets.grid.CGridView',array(
'dataProvider'=>$dataProvider,
'filter'=>$model,
'columns'=>array(
'InvoiceId',
'TrackName',
//'Bytes',
'Composer',
//'Milliseconds',
'UnitPrice',
'AlbumTitle',
'Artist',
'MediaType',
'Genre',
'LastName',
'FirstName',
//'InvoiceDate',
//'BillingCountry',
'SupportLastName',
'SupportFirstName',
'SupportPhone',
'SupportEmail',
)
));
echo CHtml::image('images/ChinookDatabaseSchema1.1.png');
Jump to Line
Something went wrong with that request. Please try again.