Ok, now that we have the knowledge, let's dissect a simple example and see how everything is connected in the code to show the welcome page of the framework.
The folder hierarchy looks like the following screenshot:
All the code related to the welcome screen we saw in the previous chapter is located inside the application folder inside module. When you add more functionality to a project, it's better to separate each section and put it in its own folder. Let's see the purpose of each folder inside a module.
Name |
Description |
---|---|
config |
This folder will contain the configuration file for this specific module. You can have more than one file and also one file per environment and load them accordingly. |
language |
Here we will store all the translation files that affect this module. We will see how the translation works on ZF2 later in the book. |
Module.php |
This is the configuration file for |
src |
The source code of the module will be stored here... |