File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -165,11 +165,17 @@ public static function normalize(array $button): array
165
165
public function props (): array
166
166
{
167
167
// helper for props that support Kirby queries
168
- $ resolve = fn ($ value ) =>
168
+ $ resolve = fn (string | null $ value ) =>
169
169
$ value ?
170
170
$ this ->model ?->toSafeString($ value ) ?? $ value :
171
171
null ;
172
172
173
+ $ options = $ this ->options ;
174
+
175
+ if (is_string ($ options ) === true ) {
176
+ $ options = $ resolve ($ options );
177
+ }
178
+
173
179
return [
174
180
...$ props = parent ::props (),
175
181
'dialog ' => $ resolve ($ props ['dialog ' ]),
@@ -178,7 +184,7 @@ public function props(): array
178
184
'link ' => $ resolve ($ props ['link ' ]),
179
185
'text ' => $ resolve ($ props ['text ' ]),
180
186
'theme ' => $ resolve ($ props ['theme ' ]),
181
- 'options ' => $ this -> options
187
+ 'options ' => $ options
182
188
];
183
189
}
184
190
Original file line number Diff line number Diff line change @@ -212,11 +212,13 @@ public function testPropsWithQueries(): void
212
212
model: $ model ,
213
213
text: 'Page: {{ page.url }} ' ,
214
214
link: 'https://getkirby.com/{{ page.slug }} ' ,
215
+ options: 'my/options/{{ page.slug }} '
215
216
);
216
217
217
218
$ props = $ component ->props ();
218
219
$ this ->assertSame ('Page: /test ' , $ props ['text ' ]);
219
220
$ this ->assertSame ('https://getkirby.com/test ' , $ props ['link ' ]);
221
+ $ this ->assertSame ('my/options/test ' , $ props ['options ' ]);
220
222
}
221
223
222
224
public function testResolve (): void
You can’t perform that action at this time.
0 commit comments