I have problem with Zend2 url helper. By default helper generate absolute path without hostname, example /foo/bar
but i need url with hostname and protocol e.g. http://example.com/foo/bar
.
$urlHelper->__invoke('foo',array(
'fooparam' => 'bar',
))
is it possible with zend url helper? And if is possible how to do it?
You can pass force_canonical
option as third parameter to url helper, eg:
$urlHelper->__invoke('foo', ['fooparam' => 'bar'], ['force_canonical' => true']);