0
He takes the methods and Patterns, but it looks like he’s ingorando the callable.
$group->group('/figure', function (\Slim\Routing\RouteCollectorProxy $group) {
$group->map(['GET'], '/view/{hash_figure}', ['\App\Controller\FigureController', 'get'])->setName('figure.get');
$group->map(['GET'], '/register/{hash_figure}', ['\App\Controller\FigureController', 'form'])->setName('figure.form');
$group->map(['POST'], '/register', ['\App\Controller\FigureController', 'post'])->setName('figure.post');
$group->map(['POST'], '/update/{hash_figure}', ['\App\Controller\FigureController', 'put'])->setName('figure.put');
$group->map(['POST'], '/view/{hash_figure}', ['\App\Controller\FigureController', 'delete'])->setName('figure.delete');
});
this is the html:
<a class="btn btn-sm btn-outline-primary" href="{{ url_for('figure.delete', {'hash_figure' : figure.hash})}}" role="button">Deletar</a>
any route I give him to go he goes, but to call the Controller function is not working and this It’s only the last one that’s not working the rest of the top is... someone knows what can be?
Could inform which error is being returned?
– João Paulo M. Bandolin
no error, it simply goes to a pag and does not execute the delete function
– Miho
Try sharing controller code as well. We have very little information to help you.
– João Paulo M. Bandolin
You set your route with the POST method, but when you click on the link (
<a>
), you access the page with the GET method.– Valdeir Psr