/** * Removes action instructions from the query of a Url instance. Only works for * normal URLs. * * @param Url $url The url to clean up. * * @return Url The url instance without action instructions-. * * @author Christian Achatz * @version * Version 0.1, 14.03.2014<br /> */ protected function removeActionInstructions(Url $url) { $mappings = $this->getActionUrMappingTokens(); $query = $url->getQuery(); // remove actions from query (either explicitly expressed by the action keyword or by url token) foreach ($query as $name => $value) { if (strpos($name, '-action') !== false || in_array($name, $mappings)) { unset($query[$name]); } } return $url->setQuery($query); }