generate:form:config

Генерировать новую "ConfigFormBase"

Использование:

drupal generate:form:config [options]
  gfc

Доступные параметры

Команда Детали
--module Имя модуля.
--class Название класса формы
--form-id Идентификатор формы
--services Загрузка сервисов из контейнера.
--config-file Добавить config файл
--inputs Создание полей ввода в форме.
--path Введите путь формы
--menu-link-gen Сгенерировать ссылку в меню
--menu-link-title Название ссылки в меню
--menu-parent Родительское меню
--menu-link-desc Описание ссылки в меню

Примеры

Generate an empty form with config file specifying the module name, the class, a form id and the path

drupal generate:form:config  \
  --module="modulename"  \
  --class="DefaultForm"  \
  --form-id="default_form"  \
  --config-file  \
  --path="/modulename/form/default"

Generate a form with 2 fields and a config file specifying the module name, the class, a form id, the inputs and the path

drupal generate:form:config  \
  --module="modulename"  \
  --class="DefaultForm"  \
  --form-id="default_form"  \
  --config-file  \
  --inputs='"name":"inputname", "type":"text_format", "label":"InputName", "options":"", "description":"Just a text input", "maxlength":"", "size":"", "default_value":"", "weight":"0", "fieldset":""'  \
  --inputs='"name":"email", "type":"email", "label":"Email", "options":"", "description":"Just an email input", "maxlength":"", "size":"", "default_value":"", "weight":"0", "fieldset":""'  \
  --path="/modulename/form/default"