Defining a module
Before creating our first module, let’s define it. All the modules have a public name in regular language, such as "Hello Word"
, as well as a technical name that must be written without spaces and contain only lowercase alphanumerical characters.
How do we choose the technical name for our module?
Even if the only constraint for the technical name is that it must contain only lowercase alphanumeric characters, we need to choose a meaningful one and find a solution to make it unique, as we don’t want two modules to have the same technical name.
One nice solution to ensure uniqueness is to prefix the technical name with the initials of the author company (so for Web Helpers, the prefix could be wh
). This prefix is then followed by the main words of the module’s regular name.
For our example "Hello World"
module, we will use the "whhelloworld"
technical name.
Technically, a module is a PHP file containing...