2009年3月17日星期二

[fw-mvc] passing viewpage id var to controller?

Hi all,
 
I'm new to ZF, and im trying to get the basics of it, which was going really good until I tried the below...
 
How to I pass the entry['id'] from my view's page to my controller so it can fetch the record that belongs to that id?
 
---------------------------
viewpage.phtml
 
<a href="<?php echo $this->baseUrl; ?>/contacts/edit/id/<?php echo $this->entry['id']; ?>">Edit</a>
 
 
----------------------------
MyController extends Zend_Controller_Action

    public function detailsAction()
    {
        $model = $this->_getModel();
 
        $this->view->entry= $model->fetchEntry();
        // How do I get the id into fetchEntry()?  EG: $this->view->entry= $model->fetchEntry($id);
    }
----------------------------
 
Thanks for your help,
Kevin

没有评论: