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
Post a Comment