Re: [fw-general] ViewRenderer inconsistency with routes and view scripts

2007-06-28 Thread Matthew Weier O'Phinney
-- Ralph Schindler <[EMAIL PROTECTED]> wrote
(on Thursday, 28 June 2007, 03:10 PM -0500):
> There is an inconsistency here, and I am getting to the root of the problem.
> 
> PotatoBob wrote:
> > 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.
> 
> There is a bug here.. basically if an action can be dispatched, then 
> there should be only one logical name for a view script based on 
> whatever convention is enforced at the ViewRenderer layer.

I think I know already what the bug is, and should be able to fix it
pretty easily. Please create a JIRA issue detailing the above so I can
resolve it.

Thanks!

-- 
Matthew Weier O'Phinney
PHP Developer| [EMAIL PROTECTED]
Zend - The PHP Company   | http://www.zend.com/


Re: [fw-general] ViewRenderer inconsistency with routes and view scripts

2007-06-28 Thread Ralph Schindler

There is an inconsistency here, and I am getting to the root of the problem.

PotatoBob wrote:

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.


Technically, ViewRenderer maintains a convention of dash-seperated 
script names (for the action).  Personally, I used to use under_score, 
but since have switched to the dashed-name convention as it is 
ultimately cleaner, and agrees with other conventions outside of file 
names itself (google urls, and css naming conventions).



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.


There is a bug here.. basically if an action can be dispatched, then 
there should be only one logical name for a view script based on 
whatever convention is enforced at the ViewRenderer layer.



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.


Routes are apples, View/Controller integration is oranges.  I can define 
routes that having nothing to do with action names in the url..



actionName.phtml or something.


Personally, I am not a fan of camelCase file names.  I do like 
under_score, but dashed-names for me has emerged as a favorite for a 
number of reasons.


-ralph