dialog example

/** * {@inheritdoc} */
  public function submitForm(array &$form, FormStateInterface $form_state) {
    $form_state->setRedirect('ajax_test.dialog_contents');
  }

  /** * AJAX callback handler for AjaxTestDialogForm. */
  public function modal(&$form, FormStateInterface $form_state) {
    return $this->dialog(TRUE);
  }

  /** * AJAX callback handler for AjaxTestDialogForm. */
  public function nonModal(&$form, FormStateInterface $form_state) {
    return $this->dialog(FALSE);
  }

  /** * Util to render dialog in ajax callback. * * @param bool $is_modal * (optional) TRUE if modal, FALSE if plain dialog. Defaults to FALSE. * * @return \Drupal\Core\Ajax\AjaxResponse * An ajax response object. */
if (!$parent instanceof Template) {
            $output->writeln(
                sprintf(
                    'Shop template by template name "%s" not found',
                    $arguments['parent']
                )
            );

            return 1;
        }

        $arguments = array_merge($arguments$this->dialog($input$output));

        $themeGenerator = $this->container->get(Generator::class);
        $themeGenerator->generateTheme($arguments$parent);

        $output->writeln(sprintf('Theme "%s" has been created successfully.', $arguments['name']));

        return 0;
    }

    /** * @return ModelRepository<Template> */
Home | Imprint | This part of the site doesn't use cookies.