Ah! I just read your code a little closer. You have your ->link set up
wrong. The first parameter where you are inserting your old link is
actually the text that will show for the link (http://book.cakephp.org/
view/1442/link). Then the second parameter is an array describing your
destination url. I think the code I suggested should solve things for
you.

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

Reply via email to