Use IMCE files browser for custom field on Drupal 8/9
You can use IMCE to select a file.
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
Syntax:
\Drupal::service('page_cache_kill_switch')->trigger();
Example on a controller:
Create a Drupal 9 project with composer
If uou have a message like : Add Phpunit via composer
CAUTION : PHPunit Version >= 8 is not compatable with drupal, so use the 7
composer require --dev phpunit/phpunit:7
This is usefull if you want to do some actions just one time.
The drush comman is php-script alias src
Example :drush --uri=drupal.loc scr /modules/custom/mymodule/scripts/test-script.php
Example :
$stopwords = ['toto', 'Pied', 'the'];
$str = 'bla bla toto bla bla Toto bla bla Tôtô bla bla totô bla bla bla bla the thé pied pïed pîéd';
function MYMODULE_views_pre_render(ViewExecutable $view) {
if ($view->id() == 'ABC') {
$view->setTitle('MY CUSTOM TITLE');
}
}
Drush 9 is finally here with some much-awaited changes. Drush 9 commands are now classes and .inc files are obsolete. Drush commands will now be based on the Annotated Command format. This will change the fundamental structure of custom Drush commands.