Created
January 22, 2014 17:04
-
-
Save fedir/8562632 to your computer and use it in GitHub Desktop.
Extbase to JSON
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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