<news>
<route>news/:article/*</route>
<defaults>
<module>content</module>
<controller>index</controller>
<action>display</action>
<article></article>
<type>news</type>
</defaults>
</news>
(Which is basically sending the request to a generic content module so that
blogs, news, events etc. are all based off the same database structure and
module but with different urls.)
Is it better to define a route for the news home page (i.e. a list of
articles) or redirect the 'display' action to the list action when no
article is set?
Display would check if an article has been set (which you will not is
optional in the above route / replaced with an empty value if not set), if
not it would call forward to 'list'. Otherwise I'd have another route as
above but simply without the parameter 'article'.
I can't decide which is more efficient, on one hand the route is going to be
loaded on every page view whether in the news section or not (as site nav
etc uses the route as part of the uri helper) on the other the site is
dispatched twice doing page and acl checking again.
So what's best? does it make a difference? and should I care?!
Also can I mix regex, standard and simple routers?
Thanks
-----
Simon
http://www.ajb007.co.uk/
--
View this message in context: http://www.nabble.com/Define-route-or-use-Action-_forward%28%29-tp19020459p19020459.html
Sent from the Zend MVC mailing list archive at Nabble.com.
没有评论:
发表评论