This post contains the recommended structure for an application developed using the Zend Framework based on the (ZF) quick start, but there are several changes made by me. I won't use the application/controllers folder, I will put my default controllers in the homepage module directory which is my default module. As you can see the modules have a MVC.
Models can be used to read and write data into a MySQL database, but they can also be used to read / write data in other types of storages like a NoSQL database, an XML file or even an external API (a service). The models directory has several sub folders, for mongoDB models, for MySQL (or MariaDB) models, for session management models and another one for the xml (read / write) models. In this project we will only need and create MySQL models.
The views folders in each module directory contain the view scripts for the actions and there is a helpers folders for module specific helpers. The helpers that can be used website wide are put in the helpers folder that is in the layout directory.
The controllers directory will contain the controllers. The default Module (which is the homepage module) will only have an IndexController. All the other modules will have at least two controllers, the IndexController that is accessible by everyone and is mostly used to display data and another controller called AdminController only accessible by administrators containing all the actions needed to manage the modules data.
Every module also has a configs folder for module configuration files, like the configuration.xml, the translations.tmx file, the routes.xml file, the acl rules and resources xml file and eventually some other xml files containing the widgets layouts. There is also a main “configs" folder in the application root directory where I store files which have values that can be used website wide by all modules.
Create a default structure
First create the following application folders structure:
* Myapp is the main project directory.
* The application folder will contain everything related to our app (our php code). We will put all our code one level lower then the “public" directory, to ensure that it isn't "publicly accessible", which is important for security reasons. If you go back to step1 and look at the vhost configuration you will notice that the vhost document root points to the applications "public" directory and not the myApp root.
* The library folder is for your library and the zend library
Download the Zend Framework 1 Library and add it to your project
Download the latest version of the Zend Framework 1 and put it into the "library" folder. In the Zend Framework compressed archive file there will be a directory called “Zend", copy that one with everything inside and paste it into your library folder.
This is how myapp directory is build, there are more layouts you could try. More Information about Zend Framework folder layouts can be found in the Zend Framework wiki.
Ok now your ready for the next step, which will be about creating the htaccess file.