Passing get values mangles my urls

Posted by SibLiant on Stack Overflow See other posts from Stack Overflow or by SibLiant
Published on 2011-11-28T20:57:51Z Indexed on 2011/11/29 17:50 UTC
Read the original article Hit count: 241

Filed under:
|
|

Just upgraded from 1.3 to 2.0.3 and I'm trying to migrate all the changes. I'm noticing that the following line

echo $this->Html->link('Quote', array('controller'=>'crm_quotes', 'action'=>'index', $lead['id'].'/'.$crmContact['CrmContact']['id']), null);

builds the url "/crm_quotes/index/15/21". When I click the link I'm taken to url:

"/crm_quotes/index/15%2F212

so it's replacing the characters with the html # but it's ultimately breaking the link.

When I manually edit the URL to the correct one:

"/crm_quotes/index/15/21"

the page loads.

Can someone enlighten me? Should I be using the url function rather than link?

I have a lot of pages that need multiple parameters passed in the url. I was using named parameters but after reading some comments by Mark Story I decided to stop the named parameters as he hinted at their possible removal from future versions.

© Stack Overflow or respective owner

Related posts about php

Related posts about cakephp