Skip to content

Instantly share code, notes, and snippets.

Created August 6, 2012 16:09
Show Gist options
  • Save anonymous/3275979 to your computer and use it in GitHub Desktop.
Save anonymous/3275979 to your computer and use it in GitHub Desktop.
errore in esecuzione della Action
// src/Acme/StoreBundle/Controller/DefaultController.php
public function showAction($id)
{
$repository = $this->getDoctrine()
->getRepository('AcmeStoreBundle:Product');
$product = $repository->find($id);
if (!$product) {
throw $this->createNotFoundException('Nessun prodotto trovato per num id: '.$id);
}
// fare qualcosa, come passare l’oggetto $product a un template
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment