Lorenzo,
You might want to
debug($this->params);
at the top of your page to see what is going on with your requests. It
sounds like the router might be doing a little work behind your back?
I would think that you could short circuit this problem by using $this-
>params to reconstruct your link a little more explicitly. When you
arrive on your page you could build your link something like this:
echo $html->link('Click Here', array(
'controller' => $this->params['controller'],
'action' => $this->params['action'],
'foo'=>'bar'
);
Regards,
Don
On May 12, 10:05 am, Lorenzo Bettini <[email protected]>
wrote:
> Hi
>
> On a view I'd like to insert a link which directs to the same url of the
> current page but adds something, so I thought I'd use
>
> echo $html->link('MyLink', array('foo'=>'bar'));
>
> which I thought would simply reload the current page with the value for
> foo tacked to the front of the URL.
>
> This is true, but not always; for instance, If I'm in the page
>
> /mysite/mymodel/view
>
> then the link above redirects to
>
> /mysite/bar/mymodel/view
>
> but If I'm in the page
>
> /mysite/mymodel/view/12
>
> then the link above still redirects to
>
> /mysite/bar/mymodel/view
>
> thus the additional argument is not kept...
>
> am I doing something wrong?
>
> thanks in advance
> Lorenzo
>
> --
> Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
> HOME:http://www.lorenzobettini.itMUSIC:http://www.purplesucker.com
> BLOGS:http://tronprog.blogspot.com http://longlivemusic.blogspot.com
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others
with their CakePHP related questions.
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php