2012-04-09 53 views
1

誰能告訴我,爲什麼從這個得到Zend的Request對象查詢

$month = $this->getRequest()->getQuery('month'); 

結果爲空字符串

呼叫來自我blogcontroller類至極做擴展化Zend_Controller_Action

網址:htp://www.domain.nl/blogmanager/?month = 2005-01

難道是我的htaccess?

Options +FollowSymlinks 
RewriteEngine On 
Options All -Indexes 
IndexIgnore * 
DirectoryIndex index.php 
RewriteCond %{SCRIPT_FILENAME} !-d 
RewriteCond %{SCRIPT_FILENAME} !-f 
RewriteRule ^(.*)$ index.php?/$1 

編輯:解決了這個問題,我不得不從重寫規則

感謝理查德

+0

我回答了我自己的問題,我現在怎麼能關閉這個問題? – Richard 2012-04-09 10:53:29

回答

2

我認爲這應該是

RewriteRule ^(.*)$ index.php/$1 
+0

謝謝讓我關閉這個職位 – Richard 2012-04-10 16:02:56

1

嘗試刪除問號:


$params = $this->getRequest()->getParams(); 

或者


$month = $this->getRequest()->getParam('month'); 
+0

已經做了,它沒有工作 – Richard 2012-04-09 10:03:58

+0

你的控制器是/博客還是/ blogmanager ..? – 2012-04-09 10:09:48

+0

這是博客管理員我跟着書的例子web.2.0應用程序 – Richard 2012-04-09 10:11:16