Commit 762a0e41 authored by Taylor Otwell's avatar Taylor Otwell

Added "needs" parameter to routes.

parent d5a11cdb
<?php namespace System\Routing;
use System\Package;
use System\Response;
class Route {
......@@ -61,6 +62,11 @@ class Route {
}
elseif (is_array($this->callback))
{
if (isset($this->callback['needs']))
{
Package::load(explode(', ', $this->callback['needs']));
}
$response = isset($this->callback['before']) ? Filter::call($this->callback['before'], array(), true) : null;
if (is_null($response) and ! is_null($handler = $this->find_route_function()))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment