Added "needs" parameter to routes.
This commit is contained in:
parent
d5a11cdb71
commit
762a0e4175
|
@ -1,5 +1,6 @@
|
||||||
<?php namespace System\Routing;
|
<?php namespace System\Routing;
|
||||||
|
|
||||||
|
use System\Package;
|
||||||
use System\Response;
|
use System\Response;
|
||||||
|
|
||||||
class Route {
|
class Route {
|
||||||
|
@ -61,6 +62,11 @@ public function call()
|
||||||
}
|
}
|
||||||
elseif (is_array($this->callback))
|
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;
|
$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()))
|
if (is_null($response) and ! is_null($handler = $this->find_route_function()))
|
||||||
|
|
Loading…
Reference in New Issue