Create page with select, checkbox, textarea ... programmatically

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

All just simple string values, URL of course valid URL

Checkbox: true/false

Thanks @pixelijn

Checkbox: true/false … you mean radio: true/false

And for checkbox, an array of value ?

 'checkbox' => [ 'choice1', 'choice2', 'choice3' ]

A radio field is basically like a select, where you choose a single value out of multiple. The values can be yes/no, but also one of blue, green, yellow, so never a comma separated list of something.

In Kirby there is only checkboxes (plural), which can be one value but also multiple, which are then stored as a comma separated list (like the multiselect).

If in doubt, create such fields via blueprint, add content via the Panel and check what the Panel actually stores.