<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[
<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[
Allow Action controllers to be organized in a directory tree.Zend Framework: Action Controller Directory Tree Component Proposal
Proposed Component Name
Action Controller Directory Tree
Developer Notes
http://framework.zend.com/wiki/display/ZFDEV/Action Controller Directory Tree
Proposers
Christopher Thompson
Revision
1.1 - 22 June 2006: Created. (wiki revision: 8)
Table of Contents
1. Overview
2. References
3. Component Requirements, Constraints, and Acceptance Criteria
4. Dependencies on Other Framework Components
5. Theory of Operation
The change would allow syntax in the ":controller" parameter to allow Action controllers in sub-directories within the "controllers" directory to be referenced. I propose that the character "_" be allowed in the ":controller" parameter and that it be converted to the path separator character in the same way that Zend::loadClass() does. This will be consistent with the current formatting scheme. I do not propose that other characters be allowed in sub-directory names – only [a-zA-Z0-9] – but that option is possible.
6. Milestones / Tasks
7. Class Index
N/A
8. Use Cases
Given the code:
The URL:
www.mydomain.com/subdir_path_example/bar/
Would dispatch the Action controller in:
/path/to/my/controllers/subdir/path/ExampleController.php
9. Class Skeletons
N/A
]]></ac:plain-text-body></ac:macro>]]></ac:plain-text-body></ac:macro>
10 Comments
comments.show.hideJun 23, 2006
Richard Thomas
<p>I like the idea, maybe you could look into creating a patch for RewriteRouter that adds this support? I don't see it being a whole seperate class really?</p>
Jun 23, 2006
Christopher Thompson
<p>This is proposed at a change mainly to the Dispatcher, but some other changes may be necessary (based on my making this change on the 1.1 code a while back)</p>
Jul 07, 2006
Matthew Ratzloff
<p>Like it, but I would allow either _ or - to divide directories. Some people prefer dashes in the URLs.</p>
<p>www.mydomain.com/subdir-path-example/bar</p>
<p>It's a pretty simple proposal, really, so I don't have anything more substantive to contribute. <ac:emoticon ac:name="smile" /></p>
Aug 11, 2006
Nikolai Luthman
<p>I'm more interested in a way to specify the sub directory for a route, for example a url of <a class="external-link" href="http://example.org/admin/controller/action/params">http://example.org/admin/controller/action/params</a> could be configured to look in controller_dir/admin/ControllerController.php.</p>
<p>As for your proposal, I don't mind it being implemented, but I would like to be able to disable it too.</p>
Sep 20, 2006
Rob Allen
<p>I am looking for this ability too Nikolai.</p>
<p>URLs of the form:</p>
<p><a class="external-link" href="http://example.com/members/XX/YY">http://example.com/members/XX/YY</a>
<a class="external-link" href="http://example.com/admin/XX/YY">http://example.com/admin/XX/YY</a></p>
<p>"look better" than</p>
<p><a class="external-link" href="http://example.com/members_XX/YY">http://example.com/members_XX/YY</a>
<a class="external-link" href="http://example.com/admin_XX/YY">http://example.com/admin_XX/YY</a></p>
<p>(IMO!)</p>
Sep 21, 2006
Max Stockner
<p>I just have to agree to Rob and Nikolai.</p>
<p>With Slashes instead of Underscore we could also define the areas more clearly.</p>
Oct 10, 2006
Matthew Weier O'Phinney
<p>The only part of this proposal that I see as beneficial is the ability to have the controllers themselves within a tree. As it is, I believe this would only require:</p>
<p>1. Creating (rewrite) router rules that map a controller to a valid class name: :controller => Some_Subdir_Class<br />
2. Modifying the dispatcher's <em>formatName() to allow the '</em>' in names; thus, class names could indicate controllers in a tree.</p>
<p>If this will resolve the issue, I am willing to accept this proposal.</p>
Oct 11, 2006
Matthew Weier O'Phinney
<ac:macro ac:name="note"><ac:parameter ac:name="title">Zend Comment</ac:parameter><ac:rich-text-body>
<p>We are accepting this proposal, using Matthew's second point. Matthew will do the change (one line change), and it will be incorporated into the MVC refactoring when it is released.</p></ac:rich-text-body></ac:macro>
Mar 18, 2008
Sebastian Krebs
<p>And whats happened?</p>
Mar 18, 2009
Wil Sinclair
<p>This proposal appears abandoned. Archiving for now.</p>