mirror of
https://github.com/wintercms/winter.git
synced 2024-06-28 05:33:29 +02:00
Allow passing explicit content to hints
This commit is contained in:
parent
c4c11cf2f0
commit
48b4a137fa
@ -592,7 +592,8 @@ class Controller extends Extendable
|
||||
|
||||
/**
|
||||
* Renders a hint partial, used for displaying informative information that
|
||||
* can be hidden by the user.
|
||||
* can be hidden by the user. If you don't want to render a partial, you can
|
||||
* supply content via the 'content' key of $params.
|
||||
* @param string $name Unique key name
|
||||
* @param string $partial Reference to content (partial name)
|
||||
* @param array $params Extra parameters
|
||||
@ -612,6 +613,7 @@ class Controller extends Extendable
|
||||
return $this->makeLayoutPartial('hint', [
|
||||
'hintName' => $name,
|
||||
'hintPartial' => $partial,
|
||||
'hintContent' => array_get($params, 'content'),
|
||||
'hintParams' => $params
|
||||
] + $params);
|
||||
}
|
||||
|
@ -25,7 +25,11 @@
|
||||
</div>
|
||||
<?php endif ?>
|
||||
<div class="content">
|
||||
<?= $this->makePartial($hintPartial, $hintParams) ?>
|
||||
<?php if ($hintContent): ?>
|
||||
<?= $hintContent ?>
|
||||
<?php else: ?>
|
||||
<?= $this->makePartial($hintPartial, $hintParams) ?>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif ?>
|
Loading…
x
Reference in New Issue
Block a user