ViewRenerer is inconsisteny with the default routes and possibly custom
routes because instead of rendering 'actionName.phtml' which would be
consistent with the name of the action it renders the action specified in
the url.

An example of this would be valid urls /foo/fooBar and /foo/foo_bar which
would route to the same action in controller foo and action fooBarAction().
The problem here is with ViewRenderer, it will use the action supplied in
the url for the name of the view script. So /foo/fooBar would render
fooBar.phtml while /foo/foo_bar would render 'foo_bar.phtml' this is a
problem because it would throw a 'cannot find view script' exception on a
valid url from the router's point of view.

Some may argue that this doesn't matter, but VR should be consistent with
the rest of the framework. A route that is valid should be translated no
matter the view script name.

Suppose only intended the user to visit /foo/foobar, but the user visits
/foo/foo_bar then they would get a 'view script' not found exception
(usually caught by the errorController) but the point is that the action 
was dispatched, so VR should render the view.

If you still don't understand what I just said (I know, it's confusing), but
the problem is VR translates whatever was provided by ':action' in the spec
as the view script to render. The solution I believe is that  VR should
stick to a solid naming convention for view scripts either by
actionName.phtml or something.
-- 
View this message in context: 
http://www.nabble.com/ViewRenderer-inconsistency-with-routes-and-view-scripts-tf3996483s16154.html#a11349989
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to