We are using the Zend Router and it seems that its overwriting the parameters that are sent by forms. The only parameters that arrive to the controller are the params from the Url.
Does anyone know why this is happening?
Here is the config file:
; Routing config
routes.groups.route = groups/:group/:type/:idPost/:postUrl/:page
routes.groups.defaults.controller = groups
routes.groups.defaults.action = index
routes.groups.defaults.type = main
routes.groups.defaults.idPost =
routes.groups.defaults.postUrl =
routes.groups.defaults.page = 1
And the form:
<form action="<?= $this->_view->baseUrl ?>/groups/<?= $group['groupUrl'] ?>/deletepost/" method="post">
<input type="hidden" name="formUrl" value="<?=$formUrl ?> />
...
</form>
Controller:
public function deletepostAction() {
$params = $this->getRequest()->getParams();
print_r($params);
die;
}
...that outputs:
Array
(
[group] => dandy-handwriting
[type] => deletepost
[idPost] =>
[controller] => groups
[action] => index
[postUrl] =>
[idGroup] => 1
[lang] => en
)
note that "formUrl" is missing, its only the parameters from the router.