fix #72 - update to Kirby 4.5

This commit is contained in:
isUnknown 2025-01-07 16:59:31 +01:00
parent cb1f842fc9
commit 44d08b3e21
273 changed files with 678 additions and 54176 deletions

View file

@ -30,7 +30,9 @@ class OptionsQuery extends OptionsProvider
public function __construct(
public string $query,
public string|null $text = null,
public string|null $value = null
public string|null $value = null,
public string|null $icon = null,
public string|null $info = null
) {
}
@ -56,8 +58,10 @@ class OptionsQuery extends OptionsProvider
return new static(
query: $props['query'] ?? $props['fetch'],
text: $props['text'] ?? null,
value: $props['value'] ?? null
text : $props['text'] ?? null,
value: $props['value'] ?? null,
icon : $props['icon'] ?? null,
info : $props['info'] ?? null
);
}
@ -178,7 +182,11 @@ class OptionsQuery extends OptionsProvider
$safeMethod = $safeMode === true ? 'toSafeString' : 'toString';
$text = $model->$safeMethod($this->text ?? $text, $data);
return compact('text', 'value');
// additional data
$icon = $this->icon !== null ? $model->toString($this->icon, $data) : null;
$info = $this->info !== null ? $model->$safeMethod($this->info, $data) : null;
return compact('text', 'value', 'icon', 'info');
});
return $this->options = Options::factory($options);