refactoring, added uri class.

This commit is contained in:
Taylor Otwell
2011-09-20 21:28:19 -05:00
parent 1463617f13
commit 47db2ff19b
16 changed files with 548 additions and 285 deletions

View File

@@ -99,7 +99,10 @@ class Route {
// route is delegating the responsibility for handling the request to a controller.
elseif (is_array($this->callback))
{
$callback = Arr::first($this->callback, function($key, $value) {return $key == 'delegate' or $value instanceof Closure;});
$callback = Arr::first($this->callback, function($key, $value)
{
return $key == 'delegate' or $value instanceof Closure;
});
return ($callback instanceof Closure) ? call_user_func_array($callback, $this->parameters) : new Delegate($callback);
}
@@ -121,7 +124,12 @@ class Route {
*/
public function filters($name)
{
return (is_array($this->callback) and isset($this->callback[$name])) ? explode(', ', $this->callback[$name]) : array();
if (is_array($this->callback) and isset($this->callback[$name]))
{
return explode(', ', $this->callback[$name]);
}
return array();
}
/**