drupal-code-generator icon indicating copy to clipboard operation
drupal-code-generator copied to clipboard

Provide a replacement for Drupal Console generate:ajax:command

Open JPustkuchen opened this issue 1 year ago • 2 comments

I just read through https://weknowinc.com/blog/creating-custom-ajax-command-drupal-8 as I need a custom AJAX Command (AjaxResponse).

I first looked into drush gen but couldn't find a command for that. drupal generate:ajax:command shows:

drupal.sh is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. There is no replacement. See https://www.drupal.org/node/3241346

The command can be found here: https://github.com/hechoendrupal/drupal-console-en/blob/master/translations/generate.ajax.command.yml

Describe the solution you'd like to propose Provide a drush gen replacement for that command to generate custom AjaxResponse Commands.

JPustkuchen avatar Dec 22 '23 11:12 JPustkuchen

Previous request #63

Chi-teck avatar Dec 22 '23 11:12 Chi-teck

Thanks @Chi-teck! It's used to provide further AJAX actions additional to the core ones: https://www.drupal.org/docs/drupal-apis/ajax-api/core-ajax-callback-commands

For example, to execute custom JS code via PHP to run APIs or other JavaScript stuff with AJAX.

JPustkuchen avatar Dec 22 '23 11:12 JPustkuchen