Im stay a few days with this problem. I just read the documentation of this Bundle, but im trying all and nothing work.
The problem is always: No route found for "GET /produtos". Im only want a make HTTP get,new,post,put,delete work in html.twig .
This is my controller with my function:
public function cgetAction() {
$em = $this->getDoctrine()->getManager();
$data = $em->getRepository('ModelBundle:Produto')->findAll();
$view = $this->view($data, 200)
->setTemplate("ModelBundle:produto:getProdutos.html.twig")
->setTemplateVar('produto')
;
return $this->handleView($view);
} // "get_users" [GET] /users
And this my config.yml(FOSRestBundle already installed), configuration of FOSRestBundle:
fos_rest:
allowed_methods_listener: true
view:
formats:
rss: true
xml: false
templating_formats:
html: true
force_redirects:
html: true
failed_validation: HTTP_BAD_REQUEST
default_engine: twig
routing_loader:
default_format: json
This is routing.yml
produtos:
type: rest
resource: "@ModelBundle\Controller\ProdutosController"
my debug:router is not showing a route. help me please guys thanks