"空间"呼叫小工具时的字符或" echo $ Content"

时间:2014-06-26 10:57:53

标签: yii

当我渲染CListView小部件时,在项目之间打印空格("")(在下图中显示),为什么?我该如何删除它们? 感谢。

image

索引视图代码:

    <div class="borderproject">
    <?php $this->widget('zii.widgets.CListView', array(
        'dataProvider'=>$dataProvider,
        'itemView'=>'_view',
        'template'=>'{items}{pager}',
    )); ?>
    </div>

_view文件内容:

<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>

的actionIndex

public function actionIndex()
{
    $dataProvider=new CActiveDataProvider('Projects');
    $this->layout = 'clientSide';
    $this->render('index',array(
        'dataProvider'=>$dataProvider,
    ));

}

1 个答案:

答案 0 :(得分:0)

尝试转换_view编码

中的文件UTF-8 without BOM