Browse Source

fixed a few controller delegation issues.

Taylor Otwell 13 years ago
parent
commit
195f7862cb
2 changed files with 2 additions and 2 deletions
  1. 1 1
      laravel/controller.php
  2. 1 1
      laravel/routing/handler.php

+ 1 - 1
laravel/controller.php

@@ -11,7 +11,7 @@ abstract class Controller {
 	 * @param  Request  $request
 	 * @return mixed
 	 */
-	public function before(Request $request) {}
+	public function before($request) {}
 
 	/**
 	 * Magic Method to handle calls to undefined functions on the controller.

+ 1 - 1
laravel/routing/handler.php

@@ -126,7 +126,7 @@ class Handler {
 
 		$controller = $this->resolve($controller);
 
-		$response = $controller->before($this->request);
+		$response = ($method == 'before' or strncmp($method, '_', 1) === 0) ? new Error('404') : $controller->before($this->request);
 
 		return (is_null($response)) ? call_user_func_array(array($controller, $method), $parameters) : $response;
 	}