Skip to content

Instantly share code, notes, and snippets.

@cyberlex404
Created August 22, 2017 22:56
Show Gist options
  • Select an option

  • Save cyberlex404/0f1288a5a60296de5b9e3b41e9742339 to your computer and use it in GitHub Desktop.

Select an option

Save cyberlex404/0f1288a5a60296de5b9e3b41e9742339 to your computer and use it in GitHub Desktop.
Administration page
<?php
namespace Drupal\home_holiday\Controller;
use Drupal\Core\Controller\ControllerBase;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Drupal\system\SystemManager;
/**
* Class HolidayStructure.
*/
class HolidayStructure extends ControllerBase {
/**
* Drupal\system\SystemManager definition.
*
* @var \Drupal\system\SystemManager
*/
protected $systemManager;
/**
* Constructs a new HolidayStructure object.
*/
public function __construct(SystemManager $system_manager) {
$this->systemManager = $system_manager;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container) {
return new static(
$container->get('system.manager')
);
}
/**
* Hello.
*
* @return array
*
*/
public function structure() {
return $this->systemManager->getBlockContents();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment