Amis,Pagination dans Zend
Je veux créer une pagination dans Zend Framework. Je suis nouveau à ZF.
index.phtml est donnée ci-dessous
<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>
Mon contrôleur d'index est inférieur
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();
}
}
Je suis une réponse et j'ai essayé et obtenir seulement output.I partielles am créer un « pagination.phtml » et emmagasinés dans « vues/scripts/» et ajouter la ligne donnée dans mon index .phtml '$ this-> paginationControl ($ this-> paginator,' Sliding ',' pagination.phtml ') ;. Mais seulement les 10 premiers éléments sont affichés, n'affichent pas les liens suivants.Comment le résoudre ?? – Rakes