Permalink
Browse files

Stack filters

  • Loading branch information...
1 parent 484a737 commit 25dde8eb84de80352b54b020810122a98802e7a9 @codler committed Feb 24, 2012
Showing with 12 additions and 1 deletion.
  1. +12 −1 laravel/routing/filter.php
View
@@ -39,7 +39,18 @@ public static function register($name, Closure $callback)
{
if (isset(static::$aliases[$name])) $name = static::$aliases[$name];
- static::$filters[$name] = $callback;
+ if (isset(static::$filters[$name]))
+ {
+ $old = static::$filters[$name];
+ static::$filters[$name] = function() use ($old, $callback) {
+ call_user_func_array($callback, func_get_args());
+ call_user_func_array($old, func_get_args());
+ };
+ }
+ else
+ {
+ static::$filters[$name] = $callback;
+ }
}
/**

0 comments on commit 25dde8e

Please sign in to comment.