Acme\DemoBundle\Controller\TodoController::getTodoAction PHP Method

getTodoAction() public method

Get a single todo.
public getTodoAction ( integer $id ) : Response
$id integer the todo id
return Symfony\Component\HttpFoundation\Response
    public function getTodoAction($id)
    {
        $data = $this->getDoctrine()->getRepository('AcmeDemoBundle:Todo')->find($id);
        if (!$data) {
            throw $this->createNotFoundException("Todo does not exist.");
        }
        $view = $this->view($data, 200)->setTemplate('AcmeDemoBundle:Todo:getTodo.html.twig')->setTemplateVar('todo');
        return $this->handleView($view);
    }