See https://www.drupal.org/project/drupal/issues/3089751 & https://www.drupal.org/forum/support/theme-development/2018-12-08/prevent-form-actions-from-appearing-in-a-modal-dialog
In mytheme.libraries.yml
dialog.ajax:
js:| // Format/fix uncommitted files | |
| "scripts": { | |
| "codefix": "for F in $(git diff --name-only); do vendor/bin/phpcbf \"$F\"; done", | |
| } | |
| // ... |
| <?php | |
| namespace Drupal\mymodule\Form; | |
| use Drupal\Core\Form\FormBase; | |
| use Drupal\Core\Form\FormStateInterface; | |
| /** | |
| * Provides a custom form. | |
| */ |
| <?php | |
| /** | |
| * @file | |
| * Contains a custom function to get the title from a Url. | |
| */ | |
| use Drupal\Core\Url; | |
| use Symfony\Component\HttpFoundation\Request; |
| /// Make element fully-clickable. | |
| /// @author Matthieu Scarset | |
| /// @param string $element | |
| /// (optional) The button element which should get the click. Default: 'a'. | |
| /// @param string $wrapper | |
| /// (optional) The element's HTML wrapper(s), useful if convoluted markup. Default: empty string. | |
| /// @link https://gist.github.com/MatthieuScarset/397da3b000ce6d9523dd50f525eabaf0 | |
| /// | |
| /// @example Simple card div with the link directly inside. | |
| /// <div class="fullclick"> |
| // SPDX-License-Identifier: MIT | |
| pragma solidity ^0.8.9; | |
| // Unlike the string type, ShortString is a value type that can be made immutable. | |
| // It supports strings of at most 32 bytes and assumes they don't contain null bytes. | |
| type ShortString is bytes32; | |
| error StringTooLong(string s); |
| <?php | |
| /** | |
| * Implements hook_entity_base_field_info(). | |
| */ | |
| function mymodule_entity_base_field_info(EntityTypeInterface $entity_type) { | |
| if ($entity_type->id() == 'user') { | |
| $fields = []; | |
| $default_field_definition = [ |
| $args = []; | |
| $form['user_in_charge'] += [ | |
| '#title' => t('Entity autocomplete'), | |
| '#type' => 'entity_autocomplete', | |
| '#selection_handler' => 'views', | |
| '#selection_settings' => [ | |
| 'view' => [ | |
| 'view_name' => 'view_machine_name', | |
| 'display_name' => 'entity_reference', |
| name: wordpress | |
| recipe: wordpress | |
| services: | |
| appserver: | |
| webroot: . | |
| xdebug: debug | |
| config: | |
| php: .vscode/php.ini | |
| tooling: | |
| install:wordpress: |
| <?php | |
| // Reorder actions. | |
| $order = [ | |
| 'previous', | |
| 'reset', | |
| 'submit', | |
| 'preview_next', | |
| ]; |