controller.php 708 B

12345678910111213141516171819202122232425262728293031
  1. <?php namespace Laravel;
  2. abstract class Controller {
  3. /**
  4. * A stub method that will be called before every request to the controller.
  5. *
  6. * If a value is returned by the method, it will be halt the request process
  7. * and will be considered the response to the request.
  8. *
  9. * @return mixed
  10. */
  11. public function before() {}
  12. /**
  13. * Magic Method for getting items from the application instance.
  14. */
  15. public function __get($key)
  16. {
  17. return IoC::resolve('laravel.application')->$key;
  18. }
  19. /**
  20. * Magic Method to handle calls to undefined functions on the controller.
  21. */
  22. public function __call($method, $parameters)
  23. {
  24. return IoC::resolve('laravel.application')->responder->error('404');
  25. }
  26. }