我是新的zend框架,我有我的问题得到一个GET参数(zend框架1.12.3)。我想我必须输入
localhost/controller/parameter/value
创建一个GET参数,然后在控制器中:
$id = $this->getRequest()->getParam( 'id');
$this->view->id= $id;
但是我得到这个服务器错误:
GET /localhost/controller/parameter/1 HTTP/1.1" 404 7173
我错过了什么?
如果ID是url的一部分,而不是url的一部分,则可以使用
要检索ID参数,您的URL应该看起来像:http://domain.com/controller/action/id/12