HelloWorld
module we created in the Getting started section, but a more complex scenario like an e-commerce site might need modules like Products
, Cart
, Payments
, ProductCategories
, Search
and so, for example.baseCoreModules
setup key of Engine::init. See the Deep lifecycle section for more details on this.init
method of the module is called, which does the following:end
method is called./src
directory of your app, and also in their own subdirectory, which has to be named exactly like your module. The file name has to be also the exact name of you module, plus the .php
extension.You can change the default/src
directory for the one of your choice by setting theappModulesDir
setup key when calling Engine::init​
Products
, it should be stored on the /src/Products/Products.php
directory.Note that both the subdirectory and the file name itself are case-sensitive.
/config
directory by default, but you can set your own directory specifying the configDir
setup key in Engine::init​/config/Database.config.php
lt;ModuleName>Config
. For example, this is how a configuration file for the HtmlDocument module would look:DATABASE_FIELD_TYPE_INTEGER
, DATABASE_FIELD_TYPE_TIMESTAMP
and DATABASE_FIELD_TYPE_STRING
..constants.php
extension. For example, the constants file for a module calledProducts
would be stored in /src/Products/Products.constants.php
, and it might look like this: