Hi there.
I have a virtual page. But i just want to set one field. The other content data should be set by the desired page. Is there a method to get the default content of the page to merge it with the incoming value?
return [
[
'pattern' => 'shop/(:any)',
'action' => function ($name) {
return Page::factory([
'slug' => 'shop',
'template' => 'shop',
'model' => 'shop',
'content' => array_merge([
"my_data" => $name
])
]);
}
]
];
}
If i run this route. I get this error:
preg_replace_callback(): Passing null to parameter #3 ($subject) of type array|string is deprecated
in
kirby/src/Text/KirbyTags.php line 33