first version
This commit is contained in:
36
kirby/config/sections/info.php
Executable file
36
kirby/config/sections/info.php
Executable file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Kirby\Toolkit\I18n;
|
||||
|
||||
return [
|
||||
'mixins' => [
|
||||
'headline'
|
||||
],
|
||||
'props' => [
|
||||
'text' => function ($text = null) {
|
||||
return I18n::translate($text, $text);
|
||||
},
|
||||
'theme' => function (string $theme = null) {
|
||||
return $theme;
|
||||
}
|
||||
],
|
||||
'computed' => [
|
||||
'text' => function () {
|
||||
if ($this->text) {
|
||||
$text = $this->model()->toString($this->text);
|
||||
$text = $this->kirby()->kirbytext($text);
|
||||
|
||||
return $text;
|
||||
}
|
||||
},
|
||||
],
|
||||
'toArray' => function () {
|
||||
return [
|
||||
'options' => [
|
||||
'headline' => $this->headline,
|
||||
'text' => $this->text,
|
||||
'theme' => $this->theme
|
||||
]
|
||||
];
|
||||
}
|
||||
];
|
Reference in New Issue
Block a user