我是在我的第一个项目中使用zen的pa子。
<?php include "header.phtml"; ?>
<h1><?php echo $this->escape($this->title);?></h1>
<h2><?php echo $this->escape($this->description);?></h2>
<a href="register">Register</a>
<table border="1" align="center">
<tr>
<th>User Name</th>
<th>First Name</th>
<th>Last Name</th>
<th>Action</th>
</tr>
<?php
foreach($this->paginator as $record){?>
<tr>
<td><?php echo $record->user_name;?></td>
<td><?php echo $record->first_name;?></td>
<td><?php echo $record->last_name;?></td>
<td>
<a href="edit/id/<?php echo $record->id;?>">Edit</a>
|
<a href="del/id/<?php echo $record->id;?>">Delete</a>
</td>
</tr>
<?php } ?>
</table>
<?php echo $this->paginationControl($this->paginator, Sliding , pagination.phtml ); ?>
<?php include "footer.phtml"; ?>
正如我说过的那样,主食会带来罚款和工作罚款,但当我点击这些链接的时候。
<a id="edit_link" href="edit/id/<?php echo $record->id;?>">Edit</a>
or
<a id="delete_link" href="del/id/<?php echo $record->id;?>">Delete</a>
or
<a href="register">Register</a>
it is not calling the required action instead it make my url like this
(initial link) http://localhost/zend_login/web_root/index.php/task/list
after clicking any of the above link its like this
http://localhost/zend_login/web_root/index.php/task/list/page/edit/id/8
http://localhost/zend_login/web_root/index.php/task/list/page/edit/id/edit/id/23
http://localhost/zend_login/web_root/index.php/task/list/page/edit/id/edit/id/register http://localhost/zend_login/web_root/index.php/task/list/page/edit/id/edit/id/del/id/12
<>strong>note, 并非首次出现,而是在点击任何想象力时,将其与被指责的行动联系起来,并展示一种看法。 采取行动
public function listAction(){
$registry = Zend_Registry::getInstance();
$DB = $registry[ DB ];
$sql = "SELECT * FROM task ORDER BY task_name ASC";
$result = $DB->fetchAll($sql);
$page=$this->_getParam( page ,1);
$paginator = Zend_Paginator::factory($result);
$paginator->setItemCountPerPage(3);
$paginator->setCurrentPageNumber($page);
$this->view->assign( title , Task List );
$this->view->assign( description , Below, are the Task: );
$this->view->paginator=$paginator;
}