-- agatone <[EMAIL PROTECTED]> wrote
(on Friday, 20 April 2007, 02:28 AM -0700):
> I'm sorry if this was already discussed but i could find any topics about it.
> Let's say we have in our controllers folder this action file :
>
> class IndexController extends Zend_Controller_Action {
> function indexAction() { ... }
> function addAction() { ... }
> function removeAction() { ... }
> function editAction() { ... }
> function deleteAction() { ...}
> .... etc. ...
> }
>
> So at all this actions file could easily have 500+ lines, what is (in my
> oponion) very bad.
> Wouldn't be easier if actions could be in separate files - more simple
> structure ... ?
>
> Any ideas ?
Besides working on the Zend MVC, I'm also the author of Cgiapp, a PHP
port of CGI::Application. In CGI::Application, the rule of thumb is that
if you have more than seven run modes (equivalent to action methods in
ZF), then you need to refactor.
I'd suggest that you should probably refactor such a controller into
multiple controllers with their own subsets of actions.
Alternatively, consider writing your own dispatcher that dispatches to
controller/action.php. This would be fairly trivial to accomplish -- but
is not likely to go into the ZF core any time soon.
--
Matthew Weier O'Phinney
PHP Developer | [EMAIL PROTECTED]
Zend - The PHP Company | http://www.zend.com/