Developing the module
To start the module development, we will declare the basic module configurations. Open your favorite code editor, create a new file called module.xml
, and save the file in app/code/Packt/TweetsAbout/etc
. Enter this code in the file:
<?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Packt_TweetsAbout" setup_version="2.0.0"/> </config>
Magento 2.0 works with Uniform Resource Names (URN) schema validation to reference XML declarations, as you can observe in the <config>
tag. The module.xsd
file works by validating whether your module declaration follows the module declaration schema.
The <module>
tag contains the vendor and module name. Always follow this example of module name declaration: Vendor_Module
.
Under app/code/Packt/TweetsAbout/etc/frontend
, create two new files, as follows:
routes.xml
events.xml...