Kirin: I think, therefore I am.
網頁
首頁
Android Studio
pChart
2017年12月12日 星期二
Laravel 101: 新增一個最簡單的靜態頁面
這個例子只用到最簡單的 blade template 和 路由,並沒有用到 controller。
相關檔案:
resources/views/hello.blade.php
routes/web.php
步驟:
1、建立 html 的內容
新增 resource/views/hello.blade.php,並加入以下內容
<
h1
>
Hello, world!
</
h1
>
2、指定相關的路由
修改 routes/web.php,加入以下內容
Route::get(
'/'
,
function
()
{
return
view(
'hello'
); });
3、檢視頁面
假設網域名稱是 myhomestead.com,則在網址列中輸入:myhomestead.com/hello ,即可看到最簡單的靜態頁面。
沒有留言:
張貼留言
較新的文章
較舊的文章
首頁
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言