ZF2: Zend Framework 2 Full URL including host name
问题 In my view I need to draw full URL. Like this: http://hostename.com/default/url When I try to use $this->url('default', array(1,2,3)) I get only /index/get/ . Is there any Zend method to het host name or I have to use $_SERVER['HTTP_HOST'] instead? 回答1: You can use the option force_canonical on the router. All router options go into the third parameter of the url helper: url($route, $params, $options) So you can so something like this: $this->url('myroute', array('id' => 123), array('force