Created
November 15, 2015 15:50
-
-
Save LinZap/0b0fb254b22e4a15e510 to your computer and use it in GitHub Desktop.
URL Routing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// 設定專案根目錄 | |
Route::base("spa-new"); | |
Route::status(404,"./layout/404.php"); | |
// 首頁 | |
Route::get("/",function($matchs,$query){ | |
Route::render("./layout/home.php"); | |
}); | |
// 關於我 | |
Route::get("about",function($matchs,$query){ | |
Route::render("./layout/about.php"); | |
}); | |
// 作品 | |
Route::get("work",function($matchs,$query){ | |
Route::render("./layout/work.php"); | |
}); | |
// 聯繫 | |
Route::get("contact",function($matchs,$query){ | |
Route::render("./layout/contact.php"); | |
}); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
URL Routing
是 Awesome v2.2 的 Alpha 功能
上面展示是撰寫方法
lib 原始碼 GitHub
觀看 Demo