Hi, everybody!
I have the following router:
$di->set('router', function () {
return require ROOT . '/app/config/routes.php';
});
<?php
$router = new Phalcon\Mvc\Router();
$router->removeExtraSlashes(true);
$router->addGet('/contacts', 'Contacts::index');
$router->addGet('/contacts/show/{id}', 'Contacts::show');
$router->addPost('/contacts/store', 'Contacts::store');
$router->addPut('/contacts/update/{id}', 'Contacts::update');
$router->addDelete('/contacts/destroy/{id}', 'Contacts::destroy');
return $router;
Why HTTP Method Restrictions doesn't work? E.g. The table entry (id: 1) is being deleted after opening the page 'something/contacts/destroy/1' using my browser (GET Method). So, I have to use the following check:
if($this->request->isDelete()){
code...
}
Thanks for your help.