News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Rob Allen:
Thoughts on module directory structure
January 04, 2013 @ 09:09:55

Rob Allen, in his Zend Framework 2 development, has come up with a list of suggestions about the use of modules in your applications, mainly relating to the structure of the files inside of them.

I've been working on a Zend Framework 2 module within a larger project that doesn't have that many PHP class files. Specifically, it has a controller, a mapper, an entity, a service and a form. As a result, the traditional Zend Framework 2 directory structure for the Account module looks [overly complicated]. That's a lot of directories for not many files! As a result, I decided to flatten it to [something simpler].

He includes both the "before" and "after" directory structures and continues on with two more suggestions - the removal of the top level "Account" folder inside of "src/" and, finally, removing "src/" all together with a slight modification to the autoloading. With a simpler module, though, something like this might make it easier to maintain and "follow" later down the road.

0 comments voice your opinion now!
zendframework2 module structure directory minimal


blog comments powered by Disqus

Similar Posts

Evan Coury: Introduction to the Zend Framework 2 ServiceManager

Martin Shwalbe: Getting Started with REST and Zend Framework 2

Web Development Blog: Tutorial: Create a zip file from folders on the fly

EngineYard.com: Cloud Out Loud - Future of PHP (ZF2 & CakePHP)

Kevin Schroeder: Setting max_input_time (with data!)


Community Events

Don't see your event here?
Let us know!


part2 programming podcast series framework application yii2 introduction list example interview symfony api composer community opinion language project laravel php7

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework