Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / chi-teck / drupal-code-generator / templates / d8 / hook / module_implements_alter.twig
1 /**
2  * Implements hook_module_implements_alter().
3  */
4 function {{ machine_name }}_module_implements_alter(&$implementations, $hook) {
5   if ($hook == 'form_alter') {
6     // Move my_module_form_alter() to the end of the list.
7     // \Drupal::moduleHandler()->getImplementations()
8     // iterates through $implementations with a foreach loop which PHP iterates
9     // in the order that the items were added, so to move an item to the end of
10     // the array, we remove it and then add it.
11     $group = $implementations['my_module'];
12     unset($implementations['my_module']);
13     $implementations['my_module'] = $group;
14   }
15 }