开发者

Use Zend Framework in non-rewriting mode?

开发者 https://www.devze.com 2023-04-12 15:32 出处:网络
currently $ctrl->view->url() keeps building urls like this: http://开发者_运维知识库host.com/user/profile/123

currently $ctrl->view->url() keeps building urls like this:

http://开发者_运维知识库host.com/user/profile/123

but I want it to be like this:

http://host.com/index.php?controller=user&action=profile&id=123

And I hope Zend can recognize all these Params by $ctrl->request()->getParam()

Is there any way to do it? Thank you very much in advance


If you want to build an URL like that you do not need a view helper, do you? ;)

My guess it you need this for the params, so here's what i think will help you

//view.phtml
$this->url(array(
  'controller'=>'user',
  'action'=>'profile',
  'id'=>'123'
));

The above will output http://www.name.tld/user/profile/id/123 which is equivalent to the link given above.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号