Skip to content

Instantly share code, notes, and snippets.

@janit
Created January 25, 2017 19:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save janit/c38430a3fd2e8989e0856f8c78d6a0fc to your computer and use it in GitHub Desktop.
Save janit/c38430a3fd2e8989e0856f8c78d6a0fc to your computer and use it in GitHub Desktop.
<?php
public function indexAction(Request $request )
{
$appState = new AppState();
$em = $this->get('doctrine.orm.default_entity_manager');
$apartments = $em->getRepository('AppBundle:Apartment')->findByLimit(3);
$appState->setApartments($apartments);
$appState->setFetchMore(true);
return $this->render('default/index.html.twig', [
'appstate' => $appState,
'appstate_serialized' => $appState->jsonSerialize()
]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment