| @@ 91-103 (lines=13) @@ | ||
| 88 | $this->response_is_object = false; |
|
| 89 | ||
| 90 | // Call direct befores |
|
| 91 | if ( $this->befores ) { |
|
| 92 | // Reverse befores order |
|
| 93 | foreach (array_reverse($this->befores) as $mw) { |
|
| 94 | ob_start(); |
|
| 95 | $mw_result = call_user_func($mw->bindTo($this)); |
|
| 96 | $this->response .= ob_get_clean(); |
|
| 97 | if ( false === $mw_result ) { |
|
| 98 | return ['']; |
|
| 99 | } else if (is_a($mw_result,'View') || is_string($mw_result)) { |
|
| 100 | $this->response .= (string)$mw_result; |
|
| 101 | } |
|
| 102 | } |
|
| 103 | } |
|
| 104 | ||
| 105 | Event::trigger('core.route.before', $this); |
|
| 106 | ||
| @@ 138-149 (lines=12) @@ | ||
| 135 | } |
|
| 136 | ||
| 137 | // Apply afters |
|
| 138 | if ( $this->afters ) { |
|
| 139 | foreach ($this->afters as $mw) { |
|
| 140 | ob_start(); |
|
| 141 | $mw_result = call_user_func($mw->bindTo($this)); |
|
| 142 | $this->response .= ob_get_clean(); |
|
| 143 | if ( false === $mw_result ) { |
|
| 144 | return ['']; |
|
| 145 | } else if (is_a($mw_result,'View') || is_string($mw_result)) { |
|
| 146 | $this->response .= (string)$mw_result; |
|
| 147 | } |
|
| 148 | } |
|
| 149 | } |
|
| 150 | ||
| 151 | Event::trigger('core.route.after', $this); |
|
| 152 | ||