refactoring for dependency injection and testability.

This commit is contained in:
Taylor Otwell
2011-08-25 22:53:05 -05:00
parent 0b86c94551
commit 1e7850d9ba
75 changed files with 1441 additions and 1461 deletions

21
laravel/controller.php Normal file
View File

@@ -0,0 +1,21 @@
<?php namespace Laravel;
abstract class Controller {
/**
* A stub method that will be called before every request to the controller.
*
* If a value is returned by the method, it will be halt the request process
* and will be considered the response to the request.
*
* @param Request $request
* @return mixed
*/
public function before(Request $request) {}
/**
* Magic Method to handle calls to undefined functions on the controller.
*/
public function __call($method, $parameters) { return new Error('404'); }
}