2021-10-29 18:05:46 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use Kirby\Toolkit\I18n;
|
|
|
|
|
|
|
|
return [
|
2022-08-31 16:08:03 +02:00
|
|
|
'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()->toSafeString($this->text);
|
|
|
|
$text = $this->kirby()->kirbytext($text);
|
|
|
|
return $text;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
],
|
|
|
|
'toArray' => function () {
|
|
|
|
return [
|
2022-12-19 16:26:24 +01:00
|
|
|
'label' => $this->headline,
|
|
|
|
'text' => $this->text,
|
|
|
|
'theme' => $this->theme
|
2022-08-31 16:08:03 +02:00
|
|
|
];
|
|
|
|
}
|
2021-10-29 18:05:46 +02:00
|
|
|
];
|