Skip to content

Instantly share code, notes, and snippets.

@fedir
Created January 22, 2014 17:04
Show Gist options
  • Save fedir/8562632 to your computer and use it in GitHub Desktop.
Save fedir/8562632 to your computer and use it in GitHub Desktop.
Extbase to JSON
<?php
$resultArray = array();
header('Content-Type: application/json');
$dataFromRepo = $this->buildingRepository->findAll();
foreach ($dataFromRepo as $object){
$resultArray[$object->getUid()] = $object->getName();
}
echo json_encode($resultArray);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment