小编Rak*_*kes的帖子

Zend中的分页

朋友们,

我想在Zend Framework中创建分页.我是ZF的新手.

index.phtml如下

<table>
<tr>
    <th>Name</th>
    <th>Quantity</th>
    <th>&nbsp;</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>
Run Code Online (Sandbox Code Playgroud)

我的索引控制器在下面

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 = …
Run Code Online (Sandbox Code Playgroud)

zend-framework

5
推荐指数
1
解决办法
7730
查看次数

标签 统计

zend-framework ×1