The slim route is not catching the callable

Asked

Viewed 16 times

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?

  • no error, it simply goes to a pag and does not execute the delete function

  • Try sharing controller code as well. We have very little information to help you.

  • You set your route with the POST method, but when you click on the link (<a>), you access the page with the GET method.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.