-
Download
.phar
file:wget https://github.com/staempfli/magento2-code-generator/releases/download/<version>/mg2-codegen.phar
-
Make the
.phar
file executable:chmod +x ./mg2-codegen.phar
-
If you want to use the command globally on your system:
sudo cp ./mg2-codegen.phar /usr/local/bin/mg2-codegen
-
Go to your module root folder
-
List all templates:
./mg2-codegen.phar template:list
-
Generate template:
./mg2-codegen.phar template:generate <template>
NOTE:
-
This commands must be executed on the root module folder where the
registration.php
file is. -
When creating a new
module
, you must create the module parent folder first and execute the command from there.
You can also watch a more detailed video demo on Youtube:
For that you cannot use the .phar
binary, so you need to install the project:
-
If you want to contribute with new templates, just follow this manual:
If current templates do not fill your needs, you can easily create your own templates. Just follow the manual:
- PHP >= 5.6.*