2012-05-10 49 views
0

林在/訂單/測試

當我嘗試/訂單/測試拉拉=測試&巴巴=測試

public function action_test(){ 
echo var_dump($_GET); 
} 

應該輸出拉拉=測試&巴巴=中的var_dump()測試,而是它給了我:

array(1) { ["order/test"]=> string(0) "" } 

爲什麼有這個happend?我怎樣才能解決這個問題?

這是我的htaccess:

# Turn on URL rewriting 
RewriteEngine On 

# Installation directory 
RewriteBase/

# Protect hidden files from being viewed 
<Files .*> 
    Order Deny,Allow 
    Deny From All 
</Files> 

# Protect application and system files from being viewed 
RewriteRule ^(?:application|modules|system)\b.* index.php/$0 [F,L] 

# Allow any files or directories that exist to be displayed directly 
RewriteCond ${REQUEST_URI} ^.+$ 
RewriteCond %{REQUEST_FILENAME} \.(gif|jpe?g|png|pdf)$ [OR] 
RewriteCond %{REQUEST_FILENAME} -f [OR] 
RewriteCond %{REQUEST_FILENAME} -d [OR] 
RewriteCond %{REQUEST_FILENAME} -l 
RewriteRule^- [L] 

# Rewrite all other URLs to index.php/URL 
RewriteRule .* index.php?$0 [PT,L] 
+0

你的'.htaccess'裏有什麼? PS:在kohana中,您需要使用請求對象而不是超全局變量來訪問請求參數 – zerkms

+0

@zerkms我用我的訪問權限更新了問題 – Karem

回答

0

更改重寫規則

RewriteRule .* index.php?$0 [PT,L,QSA] 
1

這是我在原來的.htaccess:

# Rewrite all other URLs to index.php/URL 
RewriteRule .* index.php/$0 [PT] 

也不要使用$ _GET,但是

$this->request->query() 

改爲HMVC應用程序。