File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change 3232
3333# 範例
3434
35- 你需要先在你的 ` .htacess ` 新增這樣的規則,並將之後的網頁都導向 ` index.php ` ,
36-
37- 如此一來才能夠在 ` index.php ` 中處理任何的路由事宜。
35+ 若你在使用 Apache Server,
36+ 請先新增一個 ` .htacess ` 檔案,並加入以下內容。
37+ 且請將所有 requests 都導向 ` index.php ` ,
38+ 如此一來 Davai 才能接收任何的路由事宜並進行處理。
3839
3940```
4041RewriteEngine on
41- # PHP Extension To None PHP Extension
42+ # PHP Extension To None- PHP Extensions
4243# RewriteRule ^ /%1 [R=301,NE,L]
4344RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/(.+)\.php[^\s]* [NC]
4445RewriteRule ^ - [R=404,L]
4546
46-
47- # Hide Extension Of PHP
47+ # Hide PHP Extensions
4848RewriteCond %{REQUEST_FILENAME} !-d
4949RewriteCond %{REQUEST_FILENAME}.php -f
5050RewriteCond %{REQUEST_FILENAME} !-l
@@ -63,9 +63,9 @@ $davai = new Davai();
6363
6464  ;
6565
66- 接下來開始撰寫路徑,其中的 ` [i:userID] ` 的 ` i ` 意思是任何數字 ,而 ` userID ` 則是變數名稱,
66+ 接下來開始撰寫路徑,其中的 ` [i:userID] ` 的 ` i ` 代表「任何數字」 ,而 ` userID ` 則代表「變數名稱」。
6767
68- 你可以在詳細的教學文件中找到說明 。
68+ 你稍後可以在詳細的教學文件中找到說明 。
6969
7070``` php
7171$davai->get('/user/[i:userId]', function($userId)
You can’t perform that action at this time.
0 commit comments