home.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. class Home_Controller extends Controller {
  3. /*
  4. |--------------------------------------------------------------------------
  5. | The Default Controller
  6. |--------------------------------------------------------------------------
  7. |
  8. | Instead of using RESTful routes and anonymous functions, you might wish
  9. | to use controllers to organize your application API. You'll love them.
  10. |
  11. | To start using this controller simply remove the default route from the
  12. | application "routes.php" file. Laravel is smart enough to locate this
  13. | controller and call the default method, which is "action_index".
  14. |
  15. | This controller responds to URIs beginning with "home", and it also
  16. | serves as the default controller for the application, meaning it
  17. | handles requests to the root of the application.
  18. |
  19. | You can respond to GET requests to "/home/profile" like so:
  20. |
  21. | public function action_profile()
  22. | {
  23. | return "This is your profile!";
  24. | }
  25. |
  26. | Any extra segments are passed to the method as parameters:
  27. |
  28. | public function action_profile($id)
  29. | {
  30. | return "This is the profile for user {$id}.";
  31. | }
  32. |
  33. */
  34. public function action_index()
  35. {
  36. return View::make('home.index');
  37. }
  38. }