当我渲染CListView小部件时,在项目之间打印空格("")(在下图中显示),为什么?我该如何删除它们? 感谢。
<div class="borderproject">
<?php $this->widget('zii.widgets.CListView', array(
'dataProvider'=>$dataProvider,
'itemView'=>'_view',
'template'=>'{items}{pager}',
)); ?>
</div>
<div class="projectnum">
<div class="proimages"><img src="<?php echo Yii::app()->theme->baseUrl;?>/Images/projects/project1.jpg" class="proimgsize"/></div>
<div class="prodetail">
<div class="protitle"><a href="<?php echo Yii::app()->baseUrl;?>/projects/view?id=<?php echo CHtml::encode($data->id);?>" ><?php echo CHtml::encode($data->title); ?></a></div>
<div class="prodtext"><?php echo CHtml::encode($data->content); ?></div>
</div>
<div class="moredetail"><a style="text-decoration:none;" href="<?php echo Yii::app()->baseUrl;?>/projects/view?id=<?php echo CHtml::encode($data->id);?>" >Read more</a></div>
</div>
<div class="spproject"></div>
public function actionIndex()
{
$dataProvider=new CActiveDataProvider('Projects');
$this->layout = 'clientSide';
$this->render('index',array(
'dataProvider'=>$dataProvider,
));
}
答案 0 :(得分:0)
尝试转换_view
编码
UTF-8 without BOM