6 use Symfony\Component\DependencyInjection\ContainerInterface;
7 use Symfony\Component\HttpFoundation\Response;
8 use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
13 class Page implements ContainerInjectionInterface {
22 public static function create(ContainerInterface $container) {
23 return new Page($container->get(
'dkan_frontend.page'));
30 $this->pageBuilder = $pageBuilder;
36 public function page($name) {
37 $pageContent = $this->pageBuilder->build($name);
38 if (empty($pageContent)) {
39 $pageContent = $this->pageBuilder->build(
"404");
41 return Response::create($pageContent);
48 $pageContent = $this->pageBuilder->buildDataset($name);
49 if (empty($pageContent)) {
50 $pageContent = $this->pageBuilder->build(
"404");
53 return Response::create($pageContent);