index.phtml
<? if (count($this->paginator)): ?>
<dl>
<!-- Loop through the entries that were provided to us by the controller -->
<? foreach ($this->paginator as $entry): ?>
<dt><?= $this->escape($entry['ART_NO']) ?></dt>
<dd><?= $this->escape($entry['SELL_PR']) ?></dd>
<img height="29" alt="logo" src="images/b_add_to_cart.gif" width="92" border="0" />
<? endforeach ?>
</dl>
<? endif ?>
<?= $this->paginationControl($this->paginator, 'Sliding', 'index/pagelist.phtml'); ?>
pagelist.phtml
<?php if ($this->pageCount): ?>
<div class="paginationControl">
<!-- Previous page link -->
<?php if (isset($this->previous)): ?>
<a href="<?= $this->url(array('page' => $this->previous)); ?>">< 上一頁</a> |
<?php else: ?>
<span class="disabled">< 上一頁</span> |
<?php endif; ?>
<!-- Numbered page links -->
<?php foreach ($this->pagesInRange as $page): ?>
<?php if ($page != $this->current): ?>
<a href="<?= $this->url(array('page' => $page)); ?>"><?= $page; ?></a> |
<?php else: ?>
<?= $page; ?> |
<?php endif; ?>
<?php endforeach; ?>
<!-- Next page link -->
<?php if (isset($this->next)): ?>
<a href="<?= $this->url(array('page' => $this->next)); ?>">下一頁 ></a>
<?php else: ?>
<span class="disabled">下一頁 ></span>
<?php endif; ?>
</div>
<?php endif; ?>
控制文件
class IndexController extends Zend_Controller_Action
{
protected
視頻教程 | 常用手冊 | 常用廣告代碼 | js特效代碼 |
如對本文有疑問,請?zhí)峤坏浇涣髡搲瑥V大熱心網(wǎng)友會為你解答?。?點(diǎn)擊進(jìn)入論壇