views:

27

answers:

1

Hello Experts

<a href="<?php echo "editpromotion/".$this->result[$i]['id'].""; ?>">"Edit this Promotion"                                           </a>

Here "editpromotion" is the action to which I wish to pass the parameter:"$this->result[$i]['id']".

And in the controller action('editpromotionAction') :

I am using :

$pass = $this->getRequest()->getParams();
        $this->view->pass = $pass;

But the Output I am getting:

"array 'controller' => string 'index' (length=5) 'action' => string 'editpromotion' (length=13) 'module' => string 'default' (length=7)"

And can't see the parameter passed.

Please tell me where I am wrong and please specify me a solution for this Problem.

Thanks in advance

+2  A: 

You should configure the router, or use different link style (add id param):

<a href="<?php echo "editpromotion/id/".$this->result[$i]['id'].""; ?>">"Edit this</a>

or even better:

<a href="<?= $this->url(array('module'=>'default', 'controller'=>'index', 'action'=>'editpromotion', 'id'=>$this->result[$i]['id']), null, true); ?>">Edit this</a>
takeshin