[Laravel] 網址URL指定 (URL Setting)

繁體中文:

1、開啟app/routes.php

// 指定http://localhost:8000(假設網址)網址時,取用app/views/hello.php這個view
Route::get('/', function()
{
  return View::make('hello');
});

// 指定http://localhost:8000(假設網址)網址時,直接回傳hello
Route::get('/', function()
{
  return "hello";
});

// 指定http://localhost:8000/foo/bar網址時,取用app/views/hello.php檔案這個view
Route::get('foo/bar', function()
{
  return View::make('hello');
});

English Version:

1. Open app/routes.php file:

// Assign http://localhost:8000 url, take view file: "app/views/hello.php"
Route::get('/', function()
{
  return View::make('hello');
});

// Assign http://localhost:8000 url, return string "hello"
Route::get('/', function()
{
  return "hello";
});

// Assign http://localhost:8000/foo/bar url, take view file: "app/views/hello.php"
Route::get('foo/bar', function()
{
  return View::make('hello');
});