Moshin, that will work but will ignore any routes you might have. If you use the array syntax for creating links, Cake will look at your routes and create it from one of those, if there's a match. This can be really handy.
On Mon, May 4, 2009 at 10:33 PM, Mohsin Kabir <[email protected]> wrote: > I think it will be a solution > > $html->link('View More Photos','/listing/view/id#anchor'); > > Thanks, > Mohsin > > On Tue, May 5, 2009 at 7:44 AM, brian <[email protected]> wrote: >> >> You can also pass '#' as an extra param: >> >> $html->link( >> 'View More Photos', >> array( >> 'controller'=>'listings', >> 'action'=>'view', >> $id >> '#' => 'anchor' >> ) >> ); >> >> On Mon, May 4, 2009 at 5:55 PM, JamesF <[email protected]> wrote: >> > >> > hey there i'm a big fan of verbose linking but i was having a problem >> > linking to a named anchor in the target page >> > figured it out before i posted my question so figured i would share. >> > >> > >> > code sans named anchor link: >> > echo $html->link('View More Photos', array('controller'=>'listings', >> > 'action'=>'view', $id); >> > >> > outputs : http://mysite.com/controller/action/id >> > >> > try this to link to the anchor: >> > >> > echo $html->link('View More Photos', array('controller'=>'listings', >> > 'action'=>'view', $id . '#anchor'); >> > >> > output: http://mysite.com/controller/action/id#anchor >> > >> > > >> > >> >> > > > > -- > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---
