You could pass a Zend\Uri\Http to TreeRouteStack::assemble,

$uri = new \Zend\Uri\Http('http://foo.example.com:8080');
or
$uri = new \Zend\Uri\Http('http://foo.example.com');
$uri->setPort(8080);

$router->assemble(array(), array('name' => 'home', 'uri' => $uri));
//generates http://foo.example.com:8080/


2013/1/3 richard [via Zend Framework Community] <
[email protected]>

> Hello all,
>
> I have recently stumbled across a requirement to generate urls with non
> standard ports using zf2 Treestack Router.
>
> For example, I might want to generate the URL
> http://foo.example.com:8080/index from http://bah.example.com/lalaland
>
> I have submitted a pull request (that was very quickly closed) here:
> https://github.com/zendframework/zf2/pull/3338
>
> I am of the opinion that whilst foo.example.com:8080 is not a valid
> hostname, it is a valid uri, with hostname foo.example.com and port 8080.
>
> Is it possible to configure the router to generate
> http://foo.example.com:8080/index from http://bah.example.com/lalaland without
> changing the library codebase?
>
> Regards
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://zend-framework-community.634137.n4.nabble.com/Generating-and-accepting-Routes-with-non-standard-ports-tp4658665.html
>  To start a new topic under Zend Framework, email
> [email protected]
> To unsubscribe from Zend Framework Community, click 
> here<http://zend-framework-community.634137.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=634137&code=ZWxjb3J1bWJhQGdtYWlsLmNvbXw2MzQxMzd8LTY4ODc3NTMzOQ==>
> .
> NAML<http://zend-framework-community.634137.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: 
http://zend-framework-community.634137.n4.nabble.com/Generating-and-accepting-Routes-with-non-standard-ports-tp4658665p4658666.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to