2012-04-09 56 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