Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / chi-teck / drupal-code-generator / templates / d7 / hook / url_inbound_alter.twig
diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/url_inbound_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/url_inbound_alter.twig
new file mode 100644 (file)
index 0000000..f62e7b4
--- /dev/null
@@ -0,0 +1,10 @@
+/**
+ * Implements hook_url_inbound_alter().
+ */
+function {{ machine_name }}_url_inbound_alter(&$path, $original_path, $path_language) {
+  // Create the path user/me/edit, which allows a user to edit their account.
+  if (preg_match('|^user/me/edit(/.*)?|', $path, $matches)) {
+    global $user;
+    $path = 'user/' . $user->uid . '/edit' . $matches[1];
+  }
+}