Add/remove Cake named URL parameter for a link

你。 提交于 2019-12-24 08:41:00

问题


Using CakePHP 1.3 there are named parameters in the URL like .../name:value/... These are used for example by pagination links .../page:2/key:date/sort:desc/...

How to generate links with HtmlHelper::link() adding/deleting such named parameters from the current URL?

Basically I want create links to add/remove/modify the category:ID named parameter in the current URL. It must not touch the URL, anchor, other named parameters, GET parameters in the URL.

Or how can I pass named parameters to HtmlHelper::link()?


回答1:


link('link text', array('controller' => 'something', 'action' => 'foo', 'category' => $id))



来源:https://stackoverflow.com/questions/2789894/add-remove-cake-named-url-parameter-for-a-link

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!