Hi,
I would like to create a page programmatically and this page has select, radio, checkbox, structure field, text, url and textarea fields type.
I did that long time ago but I don’t remember how to deal with type field like select, checkbox, radio, url and textarea … :-/
Could you tell me how should I format the value for these fields? (fields with ???)
// Create Kirby pages
$content = [
'title' => 'my title',
'radio' => ????,
'checkbox' => ????,
'select' => ????,
'textarea' => ????,
'url' => ????,
'text' => 'My text',
'departments' => Yaml::encode($myStructureFieldArray),
];
$site->createChild([
'content' => $content,
'slug' => Str::slug( 'my title' ),
'template' => 'myTemplate'
]);
Thanks