staempfli/magento2-code-generator 1.0

Staempfli AG - Magento 2 Code Generator Tool

Type

staempfli-mage-tool

License

GPL-3.0

Requires
Requires (dev)

None

Suggests

None

Provides

None

Conflicts

None

Replaces

None

Magento 2 Code Generator Tool

Installation

  1. Download .phar file:

    wget https://github.com/staempfli/magento2-code-generator/releases/download/<version>/mg2-codegen.phar

  2. Make the .phar file executable:

    chmod +x ./mg2-codegen.phar

  3. If you want to use the command globally on your system:

    sudo cp ./mg2-codegen.phar /usr/local/bin/mg2-codegen

Usage

  1. Go to your module root folder

  2. List all templates: ./mg2-codegen.phar template:list

  3. Generate template: ./mg2-codegen.phar template:generate <template>

NOTE:

  • This commands mut be executed on the root module folder where the registration.php file is.

  • When creating a new module, you must create first the module parent folder and execute the command from there.

Demo

Video Demo

Create new Templates

Clone and Install project

For that you cannot use the .phar binary, so you need to install the project:

Contribute with new templates

  • If you want to contribute with new templates, just do the following:

    1. Create a new template following the manual: How to create templates

Private Templates

If current templates do not fill your needs, you can easily create your own templates. Just follow the manual:

Prerequisites

  • PHP >= 5.6.*