Bạn bè,Phân trang trong Zend
Tôi muốn tạo phân trang trong Zend Framework. Tôi mới đến ZF.
index.phtml được đưa ra dưới đây
<table>
<tr>
<th>Name</th>
<th>Quantity</th>
<th> </th>
</tr>
<?php foreach($this->orders as $order) : ?>
<tr>
<td><?php echo $this->escape($order->name);?></td>
<td><?php echo $this->escape($order->quantity);?></td>
<td>
<a href="<?php echo $this->url(array('controller'=>'index','action'=>'edit', 'id'=>$order->id));?>">Edit</a>
<a href="<?php echo $this->url(array('controller'=>'index', 'action'=>'delete', 'id'=>$order->id));?>">Delete</a>
</td>
</tr>
<?php endforeach; ?>
</table>
<p><a href="<?php echo $this->url(array('controller'=>'index','action'=>'add'));?>">Add new album</a></p>
điều khiển chỉ số của tôi là dưới
class IndexController extends Zend_Controller_Action
{
public function init()
{
/* Initialize action controller here */
}
public function indexAction()
{
$this->view->title = "My Orders";
$this->view->headTitle($this->view->title, 'PREPEND');
$orders = new Model_DbTable_Orders();
$this->view->orders = $orders->fetchAll();
}
}
Tôi có một câu trả lời và tôi đã cố gắng và nhận được chỉ output.I một phần là tạo ra một 'pagination.phtml' và lưu trữ nó trong 'views/scripts /' và thêm dòng được đưa ra trong chỉ số của tôi .phtml '$ this-> paginationControl ($ this-> paginator,' Sliding ',' pagination.phtml ') ;. Nhưng chỉ có 10 mục đầu tiên được hiển thị, không hiển thị tiếp theo - các liên kết trước. Làm thế nào để giải quyết nó ?? – Rakes