protected function processRoute()
{
$uri = $this->getCleanUri();
$uri = trim($uri, '/');
$raw = explode('/', $uri);
// rewrite module from request
if (sizeof($raw)) {
$this->setParam('_module', array_shift($raw));
}
// rewrite module from controller
if (sizeof($raw)) {
$this->setParam('_controller', array_shift($raw));
}
if ($size = sizeof($raw)) {
// save raw
$this->rawParams = $raw;
// save as index params
foreach ($raw as $i => $value) {
$this->setParam($i, $value);
}
// remove tail
if ($size % 2 == 1) {
array_pop($raw);
$size = sizeof($raw);
}
// or use array_chunk and run another loop?
for ($i = 0; $i < $size; $i = $i + 2) {
$this->setParam($raw[$i], $raw[$i + 1]);
}
}
return true;
}