Thanks Brian! Worked like a charm!
On Jun 8, 6:20 pm, brian <[email protected]> wrote:
> Use the '#' key:
>
> $paginator->options(
> array(
> 'url' => array(
> 'controller' => 'projects',
> 'action' => 'view',
> $project['Project']['id'],
> '#' => 'related'
> )
> )
> );
>
> On Mon, Jun 8, 2009 at 1:12 PM, nurvzy<[email protected]> wrote:
>
> > Hi all,
>
> > I'm a bit boggled finding a way to append an anchor to the end of a
> > paginated numbers/next/previous.
>
> > I have a controller action view that paginates a related model, pretty
> > basic. When someone clicks "next", "previous" or a number I would
> > like the url to append '#related' to the end of the URL.
>
> > This is the code I have in the view:
>
> > [code]
> > <? $paginator->options(array('url' => array('controller' =>
> > 'projects', 'action' => 'view', $project['Project']['id'],
> > '#related'))); ?>
>
> > <a name="related" />
> > <h2>Related Items</h2>
> > ....
> > ....
> > ....
> > <?php echo $paginator->prev('<< previous', array(), null, array
> > ('class'=>'disabled'));?>
> > | <?php echo $paginator->numbers();?>
> > <?php echo $paginator->next('next >>', array(), null, array
> > ('class'=>'disabled'));?>
> > [/code]
>
> > The problem is the resulting url is "/projects/view/1/#related/page:
> > 4", which doesn't work. It needs to be "/projects/view/1/page:
> > 4#related".
>
> > Any help would be appreciated,
> > Nick
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---