开发者

In Cakephp how to retain Edit id when re-posting the url with a language parameter

开发者 https://www.devze.com 2023-04-01 02:38 出处:网络
I have a multilingual website with English and Arabic support. The URL of a generated edit page has the form:

I have a multilingual website with English and Arabic support.

The URL of a generated edit page has the form:

eng/advertisements/edit/20

I use this html helper link to change the language:

$this->Html->link('English', array('language'=>'eng')

Now the problem is that when I change the language for the edit page using the above mentioned helper my language does get changed but the id is lost.

The generated URL is:

eng/advertisements/edit/

Because of this I get errors on the page, because the page gets loaded without an id.

How i can retain the id value when using the helper link method to change the language? The helper link is working fine for all the 开发者_如何学运维links where there is no requirement of id.


$this->Html->link('English', array_merge($this->params['pass'], array('language' => 'eng')));
0

精彩评论

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