Atualizar 'src/BBRouter/Route.php'
This commit is contained in:
@@ -139,9 +139,8 @@ class Route{
|
||||
|
||||
//=======================================================
|
||||
function execute(){
|
||||
|
||||
foreach ($this->_before as $key => $before){
|
||||
if(!in_array($key, $this->_middlewares_to_ignore) ){
|
||||
if(!in_array($key, $this->_middlewares_to_ignore) && !$this->_ignore ){
|
||||
call_user_func($before);
|
||||
}
|
||||
}
|
||||
@@ -211,12 +210,18 @@ class Route{
|
||||
|
||||
function middleware_ignore($name = ''){
|
||||
$this->_middlewares_to_ignore[] = $name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
function middleware_add($name = '', $function){
|
||||
function middleware_add($name = ''){
|
||||
$this->_before[$name] = $function;
|
||||
}
|
||||
|
||||
function middleware_append($name = '', $function){
|
||||
$this->_before[$name] = $function;
|
||||
}
|
||||
|
||||
|
||||
function set_weight($weigth = 0){
|
||||
$this->_weight = $weigth;
|
||||
return $this;
|
||||
|
||||
Reference in New Issue
Block a user