Skip to content

Commit 69557c8

Browse files
committed
fix theme custom controller
1 parent 3445eb1 commit 69557c8

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

src/Controller/VanillaThemeController.php

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
<?php
22
declare(strict_types=1);
33

4-
namespace SimpleSAML\Module\mymodule;
4+
namespace SimpleSAML\Module\themevanilla\Controller;
55

6-
use SimpleSAML\Configuration;
7-
use SimpleSAML\Session;
6+
use SimpleSAML\{Configuration, Logger, Session};
87
use Twig\Environment;
98
use SimpleSAML\XHTML\TemplateControllerInterface;
109

@@ -13,20 +12,20 @@ class VanillaThemeController implements TemplateControllerInterface
1312
/** @var \SimpleSAML\Configuration */
1413
protected Configuration $themeconfig;
1514

15+
/**
16+
* @var \SimpleSAML\Logger|string
17+
* @psalm-var \SimpleSAML\Logger|class-string
18+
*/
19+
protected $logger = Logger::class;
20+
1621
/**
1722
* Controller constructor.
1823
*
1924
* It initializes the global configuration and auth source configuration for the controllers implemented here.
2025
*
21-
* @param \SimpleSAML\Configuration $config The configuration to use by the controllers.
22-
* @param \SimpleSAML\Session $session The session to use by the controllers.
23-
*
2426
* @throws \Exception
2527
*/
26-
public function __construct(
27-
protected Configuration $config,
28-
protected Session $session
29-
) {
28+
public function __construct() {
3029
$this->themeconfig = Configuration::getConfig('module_themevanilla.php');
3130
}
3231

@@ -50,6 +49,10 @@ public function setUpTwig(Environment &$twig): void
5049
*/
5150
public function display(array &$data): void
5251
{
53-
$data['config'] = $this->themeconfig;
52+
$data['config'] = $this->themeconfig->toArray() ?? [];
53+
54+
$this->logger::debug(
55+
__METHOD__ . "::config data:" . var_export($data['config'], true)
56+
);
5457
}
5558
}

themes/ssp/default/_header.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<header id="header">
33
{% if config.ribbon_text is defined %}
44
<div class="corner-ribbon red">
5-
{{ 'config.ribbon_text'|trans }}
5+
{{ config.ribbon_text|trans }}
66
</div>
77
{% endif %}
88
<div class="text-center ssp-logo">

0 commit comments

Comments
 (0)