2011-08-03 08:26:40 -05:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
return array(
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| Application Routes
|
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
2011-11-02 21:27:43 -05:00
|
|
|
| Simply tell Laravel the HTTP verbs and URIs it should respond to. It's a
|
|
|
|
|
| piece of cake to create beautiful applications using the elegant RESTful
|
|
|
|
|
| routing available in Laravel.
|
2011-08-03 08:26:40 -05:00
|
|
|
|
|
2011-10-24 21:00:51 -05:00
|
|
|
| Let's respond to a simple GET request to http://example.com/hello:
|
2011-08-03 08:26:40 -05:00
|
|
|
|
|
2011-09-06 23:29:19 -05:00
|
|
|
| 'GET /hello' => function()
|
2011-08-03 08:26:40 -05:00
|
|
|
| {
|
|
|
|
|
| return 'Hello World!';
|
|
|
|
|
| }
|
|
|
|
|
|
|
|
|
|
|
| You can even respond to more than one URI:
|
|
|
|
|
|
|
2011-09-06 23:29:19 -05:00
|
|
|
| 'GET /hello, GET /world' => function()
|
2011-08-03 08:26:40 -05:00
|
|
|
| {
|
|
|
|
|
| return 'Hello World!';
|
|
|
|
|
| }
|
|
|
|
|
|
|
2011-10-24 21:00:51 -05:00
|
|
|
| It's easy to allow URI wildcards using (:num) or (:any):
|
2011-08-03 08:26:40 -05:00
|
|
|
|
|
2011-09-06 23:29:19 -05:00
|
|
|
| 'GET /hello/(:any)' => function($name)
|
2011-08-03 08:26:40 -05:00
|
|
|
| {
|
|
|
|
|
| return "Welcome, $name.";
|
|
|
|
|
| }
|
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
2011-10-05 18:35:34 -05:00
|
|
|
'GET /' => function()
|
2011-08-03 08:26:40 -05:00
|
|
|
{
|
2011-09-03 22:36:27 -05:00
|
|
|
return View::make('home.index');
|
2011-08-03 08:26:40 -05:00
|
|
|
},
|
|
|
|
|
|
2011-10-24 21:00:51 -05:00
|
|
|
);
|