How to output serialized JSON view data as an array of objects, instead of wrapped in an outer object?

Set a string for the _serialize option instead of an array. An array indicates that there might be multiple view vars that need to be serialized, and that requires them to be packed into separate object properties.

$this->set(array(
    'platformusers' => $platformusers,
    '_serialize' => 'platformusers'
));

That should give you the desired result.

Leave a Comment