php - How to get URL string in ZF2 controller -


i want url in controller method route.

$route = $this->url('my/route', array('id' => $myid), array(                 'force_canonical' => true,                     )); 

this give me route object want url

$link = "http://example.com/my/route/23"  

in variable have send other action display text.

you can generate url route way :

$params = array('id' => $myid); $url = $this->url()->fromroute('my/route', $params); 

doc: (http://framework.zend.com/manual/current/en/modules/zend.mvc.plugins.html)


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -