Search
 
SCRIPT & CODE EXAMPLE
 

PHP

RouteSubscriber disallow user routes

<?php

namespace DrupalcustomRouting;

use DrupalCoreRoutingRouteSubscriberBase;
use SymfonyComponentRoutingRouteCollection;

/**
 * Listens to the dynamic route events.
 */
class RouteSubscriber extends RouteSubscriberBase {

  /**
   * {@inheritdoc}
   */
  protected function alterRoutes(RouteCollection $collection) {
    // Always deny access to unwanted routes.
    $disallow_routes = [
      'user.login',
      'user.register',
      'user.pass',
    ];
    foreach ($disallow_routes as $disallow_route) {
      if ($route = $collection->get($disallow_route)) {
        $route->setRequirement('_access', 'FALSE');
      }
    }
  }

}
Comment

PREVIOUS NEXT
Code Example
Php :: PHP detect spam name 
Php :: how to select max write textarea value in php 
Php :: laravel count soft delete data 
Php :: Check box group submit (php) 
Php :: how to fetch data from two tables in mysqli using php 
Php :: eventon php code 
Php :: php preg_match html cross origin 
Php :: How to validate Envato Purchase Code in PHP 
Php :: form data to php Class 
Php :: acf advanced link 
Php :: Header requirements for new plugin in wordpress 
Php :: sorting table row data with php 
Php :: Input sanitization to prevent XSS 
Php :: google api for language translation in php 
Php :: js data php 
Php :: php send sms for aws sns sdk 2 
Php :: send emails with runtime configurations in laravelk 
Php :: php file structure 
Php :: php curl fail verbosly 
Php :: PHP OOP - Access Modifiers 
Php :: php pop up message 
Php :: convert a value to a float in php 
Php :: auto complete order paid 
Php :: to create html document you require a 
Php :: iterate over assets container statamic 
Php :: saber value ao escolher combobox php 
Php :: wordpress session variables 
Php :: php display result from html 
Php :: Enqueue WP scripts and styles from a single action hook. 
Php :: drop down list display only seleted item only 
ADD CONTENT
Topic
Content
Source link
Name
7+4 =