daily pastebin goal
64%
SHARE
TWEET

Untitled

a guest Jan 20th, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. login.compnay_login_form:
  2.   path: '/u/{company_name}/login'
  3.   defaults:
  4.     _controller: 'DrupalloginControllerLoginController::login_form'
  5.     _title: 'Login'
  6.   requirements:
  7.     _permission: 'access content
  8.    
  9. login.compnay_login_form:
  10.   path: '/{company_name}/login'
  11.   defaults:
  12.     _controller: 'DrupalloginControllerLoginController::login_form'
  13.     _title: 'Login'
  14.   requirements:
  15.     _permission: 'access content'
  16.    
  17. /**
  18.  * Implements hook__path_insert().
  19.  */
  20. function mymodule_path_insert($path) {
  21.   if (preg_match('/company/(.*)/', '/company/xyz', $matches) && preg_match('/node/(d+)$/', $path['source'])) {
  22.   $company_name = $matches[1];
  23.     Drupal::service('path.alias_storage')->save("/u/$company_name/login", "$company_name/login" $path['langcode']);
  24.   }
  25. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top