private function createAction()
{
// pages
$action = implode('/', $this->URL->getPages());
// init parameters
$parameters = $this->URL->getParameters();
$moduleParameters = array();
$getParameters = array();
// sort by key (important for action order)
ksort($parameters);
// loop and filter parameters
foreach ($parameters as $key => $value) {
// skip identifier
if ($key === 'identifier') {
continue;
}
// normal parameter
if (\SpoonFilter::isInteger($key)) {
$moduleParameters[] = $value;
} else {
// get parameter
$getParameters[$key] = $value;
}
}
// single language
if ($this->getContainer()->getParameter('site.multilanguage')) {
$action = LANGUAGE . '/' . $action;
}
// add to action
if (count($moduleParameters) > 0) {
$action .= '/' . implode('/', $moduleParameters);
}
if (count($getParameters) > 0) {
$action .= '?' . http_build_query($getParameters, null, '&', PHP_QUERY_RFC3986);
}
// remove trailing slash
$action = rtrim($action, '/');
// cough up action
return '/' . $action;
}