/** * List all notes for a pad. * * @Route("/pads/{id}/notes", name="pad_notes") * @Method("GET") * * @return Response */ public function notesAction(Pad $pad, Request $request) { $orderBy = $request->query->get('order', 'name'); $notes = $this->get('app.repository.note')->findBy(['pad' => $pad->getId()], $this->buildOrderBy($orderBy)); return $this->render('AppBundle:Pad:notes.html.twig', ['notes' => $notes, 'pad' => $pad]); }