Skip to content

Commit

Permalink
Apply url filters before merging current request's params.
Browse files Browse the repository at this point in the history
These allows greater control over the url manipulation. For eg. a filter
can prevent the auto setting of "plugin" key based on current request.
  • Loading branch information
ADmad committed Mar 24, 2015
1 parent ee53820 commit f9547cd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Routing/Router.php
Expand Up @@ -594,6 +594,8 @@ public static function url($url = null, $full = false)
unset($url['_ssl']);
}

$url = static::_applyUrlFilters($url);

if (!isset($url['_name'])) {
// Copy the current action if the controller is the current one.
if (empty($url['action']) &&
Expand All @@ -615,7 +617,6 @@ public static function url($url = null, $full = false)
];
}

$url = static::_applyUrlFilters($url);
$output = static::$_collection->match($url, static::$_requestContext + ['params' => $params]);
} else {
$plainString = (
Expand Down

0 comments on commit f9547cd

Please sign in to comment.