Skip to content

Instantly share code, notes, and snippets.

@RoySegall
Created March 28, 2020 16:16
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 RoySegall/adff2145b960f0bd3c1f1233d61b116d to your computer and use it in GitHub Desktop.
Save RoySegall/adff2145b960f0bd3c1f1233d61b116d to your computer and use it in GitHub Desktop.
class BlogApiController extends AbstractController
{
/**
* @Route("/api/posts/{id}", methods={"GET","HEAD"})
*/
public function show(int $id)
{
// ... return a JSON response with the post
}
/**
* @Route("/api/posts/{id}", methods={"PUT"})
*/
public function edit(int $id)
{
// ... edit a post
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment