ZF: Route to partner website URL
How can i setup a route that points to URL of a partner website?
Example:
<a href="<?php echo $this->url(array(), 'superPartnerRoute'); ?>">Try this ultra fab partner website</a>
Reason for this; the URL is quite complicated and used around the website i'm working on.
http://slippery.slick.domain.com/very/long/url/index.asp?view=23457
If this URL - for some reason - 开发者_StackOverflowchanges i need to change the url around the website.
I could just add it to the language file, but i would like to keep things separated.
So superPartnerRoute should point to http://slippery.slick.domain.com/very/long/url/index.asp?view=23457
You could just use a Hostname-Route which you chain together with a path route.
Sometimes i should just try things out before asking ;-)
Just added this to my routes.ini
resources.router.routes.superPartnerRoute.type = "Zend_Controller_Router_Route_Static"
resources.router.routes.superPartnerRoute.route = "http://slippery.slick.domain.com/very/long/url/index.asp?view=23457"
Works like a charm!
精彩评论