Skip to content
Snippets Groups Projects

Issue #915756: Add masquerade in admin menu and create a page

Open Sahal V A requested to merge issue/masquerade-915756:915756-add-masquerade-in into 8.x-2.x
4 files
+ 74
0
Compare changes
  • Side-by-side
  • Inline
Files
4
+ 53
0
<?php
namespace Drupal\masquerade\Controller;
use Drupal\Component\Plugin\PluginManagerInterface;
use Drupal\Core\Controller\ControllerBase;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Returns responses for Masquerade routes.
*/
class MasqueradeBlockController extends ControllerBase {
/**
* The plugin.manager.block service.
*
* @var \Drupal\Component\Plugin\PluginManagerInterface
*/
protected $pluginManagerBlock;
/**
* The controller constructor.
*
* @param \Drupal\Component\Plugin\PluginManagerInterface $plugin_manager_block
* The plugin.manager.block service.
*/
public function __construct(PluginManagerInterface $plugin_manager_block) {
$this->pluginManagerBlock = $plugin_manager_block;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container) {
return new static(
$container->get('plugin.manager.block')
);
}
/**
* Returns the masquerade block.
*/
public function getMasqueradeBlock() {
// Create a masquerade block instance.
$build['masquerade'] = $this->pluginManagerBlock
->createInstance('masquerade')
->build();
return $build;
}
}
Loading