Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-11-2008, 09:12 AM
SJD SJD is offline
Junior Member
 
Join Date: Apr 2008
Posts: 2
Default Zend_Layout paths

Hi

I've been looking at the recent Zend_Layout webinar (Zend_Layout and Zend _View Enhancements Webinar). Not sure if I'm missing something, but I'm confused about the paths used.

All of the paths use the name of the view script rather than the action. For example, http://layouttest.localhost/demo/ajaxy-autocomplete/ works instead of http://layouttest.localhost/demo/ajaxyAutocomplete/ (on my local server), where the view script is ajaxy-autocomplete.tpl and there is a DemoController::ajaxyAutocompleteAction method.

The documentation seems to suggest that it would work the other way round (also the way I would have expected):

"Zend_Layout uses Zend_Filter_Inflector to establish a filter chain for translating a layout name to a layout script path. By default, it uses the rules 'CamelCaseToDash' followed by 'StringToLower', and the suffix 'phtml' to transform the name to a path."

Could anyone explain what is going on?

Many thanks...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-14-2008, 10:03 AM
SJD SJD is offline
Junior Member
 
Join Date: Apr 2008
Posts: 2
Default

I've found the reason why this is happening, but it doesn't really help

By the time Zend_Controller_Action::dispatch is called, if the path is formatted as 'player-random' the action is 'playerRandomAction', but if the path is 'playerRandom' the action is 'playerrandomAction' which doesn't exist. It looks like the inflector acts on the path in the opposite way I expected (?).

So, as far as I can tell, that is how it is supposed to work. The path should be formatted as 'player-random' and that is converted to 'playerRandomAction'.

If anyone else has a better understanding, please let me know. Thanks.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 07:21 PM.