I am study Yii Blog demo, and feel it is insanely difficult for me.
What is the “template” of CListView in the below view code? I still couldn’t figure what it is and how it’s used after reading the class reference. Please help! Thank you!
<?php $this->widget('zii.widgets.CListView', array(
'dataProvider'=>$dataProvider,
'itemView'=>'_view',
'template'=>"{items}\n{pager}", // here is the template that confused me!!
)); ?>
Here is the _view.php, I didn’t find “template” is used here.
<div class="post">
<div class="title">
<table>
<tr>
<td class="span-2">
<?php $this->widget('PostDate', array('ct'=>date('F'.'<\b\r>j', $data->create_time))); ?>
</td>
<td> <?php echo CHtml::link(CHtml::encode($data->title), $data->url); ?>
</td>
</tr>
</table>
</div>
<div class="author">
posted by <?php echo $data->author->username . ' on ' . date('F j, Y',$data->create_time); ?>
</div>
<div class="content">
<?php
$this->beginWidget('Markdown', array('purifyOutput'=>true));
echo $data->content;
$this->endWidget();
?>
</div>
<div class="nav">
<b>Tags:</b>
<?php echo implode(', ', $data->tagLinks); ?>
<br/>
<?php echo CHtml::link('Permalink', $data->url); ?> |
<?php echo CHtml::link("Comments ({$data->commentCount})",$data->url.'#comments'); ?> |
Last updated on <?php echo date('F j, Y',$data->update_time); ?>
</div>
</div>