私はyiiでCListViewを次のように使用しています:
<?php $this->widget('zii.widgets.CListView', array(
'dataProvider'=>$posts,
'itemView'=>'_view',
'itemsTagName'=>'ul',
'itemsCssClass'=>'post_list',
'template'=>'{items}{pager}{summary}',
'summaryText'=>'Displaying posts {start}-{end} of {count}',
'separator'=>null,
)); ?>
ビューファイルの先頭または末尾にスペースや文字はありませんが、リストビューが作成するhtmlにより、各アイテムの間に空白行が挿入されます。その空白行を取り除く方法はありますか?
編集:
マイビューファイル:
<li><?php
echo "<article>";
echo "<header class='article-header'>";
echo "<h2>{$data->title}</h2>";
...
A bunch of other stuff here...
...
echo "</article>";
echo "<hr />";
?></li>
結果のHTML:
<ul class="post_list"> (an extra blank line here)
<li>A bunch of stuff (item 1)</li> (and here)
<li>A bunch of other stuff (item 2)</li> (here too)
</ul>
上記を正しくフォーマットすることができません...しかし、それはliが内部にあるulですが、各要素の間に空白行があります。