generate:plugin:block
Generate a plugin block
Usage:
drupal generate:plugin:block [options]
gpb
Available options
Option | Details |
---|---|
--module | The Module name. |
--class | Plugin class name |
--plugin-label | Plugin label |
--plugin-id | Plugin id |
--theme-region | Theme region to render Plugin Block |
--inputs | Create inputs in a form. |
--services | Load services from the container. |
--twigtemplate | Generate theme template |
Examples
Generate a plugin block in the header region with an input field specifying the module name, the class, the label, its id, the region and the input
drupal generate:plugin:block \
--module="modulename" \
--class="DefaultBlock" \
--label="Default block" \
--plugin-id="default_block" \
--theme-region="header" \
--inputs='"name":"inputtext", "type":"text_format", "label":"InputText", "options":"", "description":"Just an input text", "maxlength":"", "size":"", "default_value":"", "weight":"0", "fieldset":""'