Skip to end of metadata
Go to start of metadata

<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[

Zend Framework: Zend_Controller_Dispatcher Component Proposal

Proposed Component Name Zend_Controller_Dispatcher
Developer Notes http://framework.zend.com/wiki/display/ZFDEV/Zend_Controller_Dispatcher
Proposers zf@keppens.net
Revision (wiki revision: 10)

Table of Contents

1. Overview

In smal projects the current directory structure for controllers is sufficient. For bigger projects however, it might be useful to use subdirectories to group together certain functonalities for clarity reasons.

2. References

3. Component Requirements, Constraints, and Acceptance Criteria

  • KISS

4. Dependencies on Other Framework Components

5. Theory of Operation

Currently the controller in the url can't have underscores (they are filtered out). This change would keep underscores in place and replace spaces into underscores. The Zend::loadClass has to be adjusted as well so it can use subdirectories when the dirs parameter is not null.

6. Milestones / Tasks

zone: Missing {zone-data:milestones}

7. Class Index

  • Zend
  • Zend_Controller_Dispatcher

8. Use Cases

Suppose one of the parts of your website is a Forum, then you could have following urls:

forum_topic/list
forum_topic/add
forum_topic/edit
forum_topic/delete

forum_post/list
forum_post/rate
forum_post/view
forum_post/add
forum_post/edit
forum_post/delete

etc...

This would yield in following files

/application/controllers/Forum/TopicController.php => Class Forum_TopicController
/application/controllers/Forum/PostController.php => Class Forum_PostController

9. Class Skeletons

Zend.php : lijn 84, change:

to:

Zend/Controller/Dispatcher.php: lijn 167, added:

Zend/Controller/Dispatcher.php: lijn 91, change

to:

]]></ac:plain-text-body></ac:macro>

]]></ac:plain-text-body></ac:macro>

Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Sep 20, 2006

    <p>How does this differ from <a class="external-link" href="http://framework.zend.com/wiki/x/CwM">http://framework.zend.com/wiki/x/CwM</a> ?</p>

  2. Oct 10, 2006

    <p>This is substantively the same as <a class="external-link" href="http://framework.zend.com/wiki/display/ZFPROP/Action+Controller+Directory+Tree+-+Christopher+Thompson">http://framework.zend.com/wiki/display/ZFPROP/Action+Controller+Directory+Tree+-+Christopher+Thompson</a>, and my comments there apply here as well: a combination of a rewrite rule and a minor modification to Zend_Controller_Dispatcher::_formatName() will solve the issue.</p>

  3. Oct 10, 2006

    <ac:macro ac:name="note"><ac:parameter ac:name="title">Zend Comment</ac:parameter><ac:rich-text-body>
    <p>Duplicate of <a class="external-link" href="http://framework.zend.com/wiki/display/ZFPROP/Action+Controller+Directory+Tree">http://framework.zend.com/wiki/display/ZFPROP/Action+Controller+Directory+Tree</a></p></ac:rich-text-body></ac:macro>