DevTools
With the EconsorDevTools Plugin you can quickly create Plugin Skeletons without any hassle at all. Simply install and activate the plugin and you'll be able to use it's set of console commands in your shell.
Simply run bin/console on its own to check if the commands have been added - they are all prefixed by econsor:dev: so you can quicky see if they're there.
We're going to go over the commands in alphabetical order, except addmodel and addplugin, the latter of which we will quickly go through first. Model Creation has it's own article here.
addplugin
With addplugin you can - call the press - add plugins. The obvious naming will be a recurring theme here so get used to it already 😉
It will ask you for the following information about the Plugin:
Plugin Name- Type in your Plugin Name. (The Prefix Econsor will be added automatically, don't worry about it!)Technical Name- This is the technical name used in the composer.json file. It is written in kebab case so type-it-like-thisPlugin Label DE- The german Label of the Plugin (this is how it will be listed in the administration for example)Plugin Label EN- The english Label of the Plugin
After you have entered all of that information, you will be booted into the "Add something?" Routine, where you can call as many of the other commands as you want, directly for the plugin you just created. The individual commands here will be almost identical to the ones listed below - the only difference being that you don't need to specify the Plugin name.
When you're done adding stuff, select [0] Nothing and your plugin has been created!
addcartprocessor
Adds a Cart Processor to a plugin of your choice.
It will ask you for the following information:
Plugin- Select the Plugin you want to add the Processor to (type in the corresponding number)Pre or Post- Decide if you want a Pre- or Post- Processor. In most cases, you will want a Post Processor.
addcms
Adds a CMS Block and/or Element to your Plugin. (Einkaufswelt, Erlebniswelt)
It will ask you for the following information:
Plugin- Select the Plugin you want to add the CMS to (type in the corresponding number)Create CMS Block?- Do you want to create a Block? It is not necessary to do this if you want to create an element, but it's nice to have. (type in y or n)- (If yes)
Block Technical Name- The technical name of your block (in-kebab-case) - (If yes)
Block Label- The name under which it will it be listed in the CMS Page Builder - (If yes)
Block Category- The Category where the Block will be listed under in the CMS Page Builder (type in the corresponding number)
- (If yes)
Create CMS element?- Do you want to create an Element? It is not necessary to do this if you want to just create a block. (type in y or n)- (If yes)
Element Technical Name- The technical name of your element (in-kebab-case) - (If yes)
Element Label- The name under which it will it be listed in the CMS Page Builder
- (If yes)
Create Snippet Files?- Do you want to create a snippet File?. (type in y or n)- (If yes)
CMS Name- The name the snippets will be wrapped under (in-kebab-case)
- (If yes)
addcommand
Adds a console command to your Plugin
It will ask you for the following information:
Plugin- Select the Plugin you want to add the Command to (type in the corresponding number)Command Name- This is the Name used in Filenames and Namespaces, so for example type MyCommandCommand Call- This is how the command will be called later. The naming convention here iseconsor:<plugin name>:<command name>.Command Description- This is the short (!) description listed next to the command if you type inbin/consoleCommand ID- The services.xml needs a unique Command ID for this all to work. It should be easy to create one if you follow the naming convention<plugin_name>.commands.<command_name>.
addcontroller
Adds a controller to the Plugin. Generates example routes too! Fancy!
It will ask you for the following information:
Plugin- Select the Plugin you want to add the Command to (type in the corresponding number)Controller Type- Select if you want an API or a Storefront Controller (type in the corresponding number)Controller Name- This is the Name used in Filenames and Namespaces, so for example type MyController
addjsplugin
Adds an empty JavaScript Plugin
It will ask you for the following information:
Plugin- Select the Plugin you want to add the JS Plugin to (type in the corresponding number)JS Plugin Name- This is the JS Plugin's Classname, so for example type myPluginJS Plugin Filename- The Filename in-kebab-case.
addmodel
Adds a model. This is more complex and has it's own article here.
addmodule
Adds a new module to the administration
It will ask you for the following information:
Plugin- Select the Plugin you want to add the Module to (type in the corresponding number)Technical Name- The technical name of your module (in-kebab-case).Module Label- The Label that your module is listed under in the administration.Module Description- The description of your module shown in the administration.Parent Module- The parent module you want yours to be listed under in the module tree (The list on the left of the administration). (type in the corresponding number)Icon tag- Tag of the Icon you want to show on your module page. (You can also leave this empty)Module Position- The Position of your module in the module tree (number)Create/Detail Page creation- Choose if you want to generate Create/Detail Pages as this is not always necessary.
addservice
Adds a regular old Service to your plugin
Plugin- Select the Plugin you want to add the Service to (type in the corresponding number)Name- This is the Name used in Filenames and Namespaces, so for example type MyService
addsubscriber
Adds a Subscriber to your plugin
Plugin- Select the Plugin you want to add the Subscriber to (type in the corresponding number)Name- This is the Name used in Filenames and Namespaces, so for example type MySubscriber
addtwigextension
Adds a Twig Extension to your plugin. Do this to write custom Twig Filters and/or Functions.
Plugin- Select the Plugin you want to add the Subscriber to (type in the corresponding number)Filter/Function- Choose if you want to have a new|TwigFilteror aTwigFunction(). (type in the corresponding number)