RouteSubscriber.php in Open Social 8.2
Same filename in this branch
- 8.2 modules/custom/social_language/src/Routing/RouteSubscriber.php
- 8.2 modules/social_features/social_private_message/src/Routing/RouteSubscriber.php
- 8.2 modules/social_features/social_post/src/Routing/RouteSubscriber.php
- 8.2 modules/social_features/social_group/src/Routing/RouteSubscriber.php
- 8.2 modules/social_features/social_topic/src/Routing/RouteSubscriber.php
- 8.2 modules/social_features/social_user/src/Routing/RouteSubscriber.php
- 8.2 modules/social_features/social_core/src/Routing/RouteSubscriber.php
- 8.2 modules/social_features/social_comment/src/Routing/RouteSubscriber.php
Same filename and directory in other branches
- 8.9 modules/social_features/social_private_message/src/Routing/RouteSubscriber.php
- 8 modules/social_features/social_private_message/src/Routing/RouteSubscriber.php
- 8.3 modules/social_features/social_private_message/src/Routing/RouteSubscriber.php
- 8.4 modules/social_features/social_private_message/src/Routing/RouteSubscriber.php
- 8.5 modules/social_features/social_private_message/src/Routing/RouteSubscriber.php
- 8.6 modules/social_features/social_private_message/src/Routing/RouteSubscriber.php
- 8.7 modules/social_features/social_private_message/src/Routing/RouteSubscriber.php
- 8.8 modules/social_features/social_private_message/src/Routing/RouteSubscriber.php
- 10.3.x modules/social_features/social_private_message/src/Routing/RouteSubscriber.php
- 10.0.x modules/social_features/social_private_message/src/Routing/RouteSubscriber.php
- 10.1.x modules/social_features/social_private_message/src/Routing/RouteSubscriber.php
- 10.2.x modules/social_features/social_private_message/src/Routing/RouteSubscriber.php
Namespace
Drupal\social_private_message\RoutingFile
modules/social_features/social_private_message/src/Routing/RouteSubscriber.phpView source
<?php
namespace Drupal\social_private_message\Routing;
use Drupal\Core\Routing\RouteSubscriberBase;
use Symfony\Component\Routing\RouteCollection;
/**
* Class RouteSubscriber.
*
* @package Drupal\social_private_message\Routing
* Listens to the dynamic route events.
*/
class RouteSubscriber extends RouteSubscriberBase {
/**
* {@inheritdoc}
*/
protected function alterRoutes(RouteCollection $collection) {
// Route the old private message page to the inbox.
if ($route = $collection
->get('private_message.private_message_page')) {
// Deny access to this route.
$route
->setRequirement('_access', 'FALSE');
}
// Route the private message thread page.
if ($route = $collection
->get('entity.private_message_thread.canonical')) {
// Remove the page title.
$route
->setDefault('_title', '');
}
}
}
Classes
Name | Description |
---|---|
RouteSubscriber | Class RouteSubscriber. |