Create a module registration file in Magento
Learn how to create a Magento module registration.php file using ComponentRegistrar::register.
Lesson Content
Modules need two files in order to be registered & enabled in Magento.
The first is in the root of the module, and is named registration.php. This is the file that exposes this as a Magento module at the PHP-layer.
It’s a PHP best practice nowadays to declare strict types at the top of each of your PHP files with declare(strict_types=1);. Doing so ensures that variables have a specified type, otherwise a TypeError is thrown, and stops the execution of further processing.
Let’s call the ComponentRegistrar class, which comes from Magento Framework’s Component folder. This class ha...
Join the discussion!
Comments
Want to comment on this lesson?
Enroll in this course to leave comments.