zend框架中的链接传递多个参数 [英] a link pass multiple parameter in zend framework
本文介绍了zend框架中的链接传递多个参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是zend Framework 2.2.0的新手.我想创建一个链接,该链接现在要删除页面,我仅在URL中传递ID,因此我想在其中传递另一个ID.
hi i am new in zend framework 2.2.0. i want to create the a link that go to delete page right now i am passing only id in the url so i want to pass another id in it.
<a href="<?php echo $this->url('message',array('action'=>'delete', 'id' => $message->message_id));?>">Add to Trash</a>
现在此链接中的消息ID正在传递,我也想在此链接中传递另一个名为"did"的ID
right now in this link message id is passing i also want to pass one more id named "did" in this link
<a href="<?php echo $this->url('message',array('action'=>'delete', 'id' => $message->message_id,'did'=>$message->deliver_id));?>">Add to Trash</a>
我怎么能得到这个? 预先感谢
how can i get this ? thanks in advance
推荐答案
您应该使用url view helper的第三个参数($ options)在查询字符串中传递变量.示例:
You should use url view helper's third argument ($options) to pass your variables in the query string. Example:
$route = 'message';
$param = array('action' => 'delete');
$opts = array(
'query' => array(
'id' => $message->message_id,
'did' => $message->deliver_id
)
);
$this->url($route, $params, $opts);
这篇关于zend框架中的链接传递多个参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文