我正在使用Yii的扩展程序infinite-scroll-pager。我的数据提供者有6个寄存器,但我希望它只显示前3个。我怎样才能完成它? triggerPageTreshold
( sic )是否必须完成这项工作?
$listView = $this->widget(
'zii.widgets.CListView',
array(
'id' => 'activities-scroll-list',
'dataProvider' => $dataProvider,
'itemView' => '/experience/_experience_item',
'cssFile' => null,
'template' => $this->renderPartial(
'/experience/_experiences_list',
array(),
true
),
'pager' => array(
'id' => 'pager-id',
'class' => 'ext.infiniteScroll.IasPager',
'rowSelector' => '.row',
'listViewId' => 'activities-scroll-list',
'header' => 'TESTE',
'loaderText' => 'Loading...',
'options' => array(
'history' => true,
'triggerPageTreshold' => 3,
'trigger' => 'Load more'
)
),
)
);
/experience/_experiences_list
:
<div class="row">
<div id="home-experience-resume" class="wrapper-k">
<?php
echo '{summary} {items} {pager}';
?>
</div>
</div>
/experience/_experience_item
:
<article class="column-3 <?= ((($index - 1) % 3) == 0 ? 'middle' : ''); ?> equal-height">
<div class="inner-wrapper">
<div class="img-container">
<img src="/images/tmp_thumbExperiencia1.jpg" alt="<?php echo Yii::t('home','Experiência 1'); ?>" />
</div>
<div class="info-column-container">
<div class="info-column">
<p class="more-detail-link">
<img src="/images/experiences/iconLocal.png" alt="icon local"/>
<a href="#" target="_self"><?= $data->showingCity; ?></a>
</p>
<h3><?= $data->name; ?></h3>
<a class="button bt-small" href="/experience/info/<?php echo $data->id; ?>" target="_self"><?= Yii::t('home','Saber mais'); ?></a>
</div>
</div>
</div>
</article>
答案 0 :(得分:2)
使用:
'template' => '<div class="row">div id="home-experience-resume" class="wrapper-k"> {summary} {items} {pager} </div></div>',