Return error when get checkboxes in the page

Now I use kirby 2.5.5
I create a checkboxes at the page blueprints and type is images.
But I get in the page error.

In page’s template, If echo $page->field-checkboxes-name()
it can print sample-1.jpg, sample-2.jpg…
but echo $page->field-checkboxes-name()->split(’,’)
then…return error :frowning:

Which error?

I think it has to do with echoing an array?

@bvdputte is right. The split() method returns an array, so you have to loop through it to print it out:

$images = $page->checkbox_field()->split(','); 
foreach($images as $image) {
  echo $image;

Thanks all. Now I can print out images, but I can not use crop(), I want make a thumb for image, Why?

$images = $page->checkbox_field()->split(’,’);
foreach($images as $image_name) {
$image = ’ (img src="’.$page->contentURL().’/’.$image_name.’" alt="")’;
echo $image;

$images = $page->checkbox_field()->split(','); 
foreach($images as $image):
  if($img = $page->image($image)) {
 echo $img->crop(400);

Cool! Thank you texnixe!