Order and sort items with tabledrag
Draggable table Form Example
Step 1 : Form build
Draggable table Form Example
Step 1 : Form build
Example: settings for local environnement.
Create the local settings file : local.services.yml the add to local settings.php file
# Local service config
$settings['container_yamls'][] = DRUPAL_ROOT . '/sites/default/local.services.yml';
Step 1 : Add the package cweagans/composer-patchescomposer require cweagans/composer-patches
Doc : https://www.drupal.org/docs/drupal-apis/form-api/conditional-form-fields
States that can be applied to a form field element:
Import configuration file programmatically on Drupal 9 using config_update contrib module and service
//Update Module settings
\Drupal::service('config_update.config_update')->revert('system.simple', 'mymodule.settings');
State servic eallow to store variables such as state of the server temporarily or permanently
Examples:
Drupal settings file can contains variable which can use to use for different configuration in different environments.
Example:
env_name
default_info_nid
$settings['env_name'] = 'Local';
$settings['default_info_nid'] = 1';
You can use IMCE to select a file.
Method 1 : Form hook_page_attachments
This method allow to store data on drupal session using drupal session table (not php $_SESSION).
Storage is different for each users ans each visitors if anonymous