ContentAccessController.php in Content Access 8
Namespace
Drupal\content_access\ControllerFile
src/Controller/ContentAccessController.phpView source
<?php
namespace Drupal\content_access\Controller;
use Drupal\Core\Controller\ControllerBase;
use Drupal\Core\Routing\RouteMatchInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Controller routines for user routes.
*/
class ContentAccessController extends ControllerBase {
/**
* The route match.
*
* @var \Drupal\Core\Routing\RouteMatchInterface
*/
protected $routeMatch;
/**
* Constructs a ContentAccessController object.
*
* @param \Drupal\Core\Routing\RouteMatchInterface $route_match
* The current route match.
*/
public function __construct(RouteMatchInterface $route_match) {
$this->routeMatch = $route_match;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container) {
return new static($container
->get('current_route_match'));
}
/**
* Returns content access settings page title.
*/
public function getContentAccessTitle() {
$node = $this->routeMatch
->getParameter('node');
$title = $this
->t('Access control for <em>@title</em>', [
'@title' => $node
->getTitle(),
]);
return $title;
}
}
Classes
Name![]() |
Description |
---|---|
ContentAccessController | Controller routines for user routes. |