Re: Custom Route Pagination URLs

2009-02-26 Thread Miles J

I tried that and it did correctly route the url, but once you go to
another page, the custom variables in the route just keep adding up.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Custom Route Pagination URLs

2009-02-25 Thread xxkylexx

Solved the issue.

Router should have a appended /* to allow for additional parameters:

Router::connect('/:name-:id/*',
array(
'controller' => 'categories',
'action' => 'view'
),
array(
'name'=>'(.*)',
'id' => '[0-9]+'
)
);

On Feb 25, 1:30 pm, xxkylexx  wrote:
> Correction: that method returns the URL's how they would be with no
> custom route set up. i.e.http://www.localhost.com/categories/view/7/page:2
>
> On Feb 25, 12:27 pm, brian  wrote:
>
> > Try
>
> > $paginator->options(
> >         array('url' => $this->passedArgs)
> > );
>
> > On Tue, Feb 24, 2009 at 11:48 PM, xxkylexx  wrote:
>
> > > Hey guys,
> > > I can't seem to get this to work :-( . I currently have the following
> > > route set up for my categories pages, which works great:
>
> > > //Categories page route 
> > > (example:http://www.mydomain.com/category_name_here-id)
> > > Router::connect('/:name-:id',
> > >        array(
> > >                'controller' => 'categories',
> > >                'action' => 'view'
> > >        ),
> > >        array(
> > >                'name'=>'(.*)',
> > >                'id' => '[0-9]+'
> > >        )
> > > );
>
> > > Except for the fact that I cannot get my pagination URL's to properly
> > > display for this custom route. I have the following set up for my
> > > pagination options url:
>
> > > $paginator->options(
> > >        array(
> > >                'url' => array(
> > >                        'controller'=>'catgories',
> > >                        'action'=>'view',
> > >                        
> > > 'name'=>$html->slugify($category['Category']['name']),
> > >                        'id'=>$category['Category']['id']
> > >                )
> > >        )
> > > );
>
> > > Which displays the URL's like "http://www.localhost.com/categories/
> > > view/7/page:2/name:pcs", instead of "http://www.localhost.com/pcs-7/
> > > page:2".
>
> > > Any help is appreciated. Thanks!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Custom Route Pagination URLs

2009-02-25 Thread xxkylexx

Correction: that method returns the URL's how they would be with no
custom route set up. i.e. http://www.localhost.com/categories/view/7/page:2

On Feb 25, 12:27 pm, brian  wrote:
> Try
>
> $paginator->options(
>         array('url' => $this->passedArgs)
> );
>
> On Tue, Feb 24, 2009 at 11:48 PM, xxkylexx  wrote:
>
> > Hey guys,
> > I can't seem to get this to work :-( . I currently have the following
> > route set up for my categories pages, which works great:
>
> > //Categories page route 
> > (example:http://www.mydomain.com/category_name_here-id)
> > Router::connect('/:name-:id',
> >        array(
> >                'controller' => 'categories',
> >                'action' => 'view'
> >        ),
> >        array(
> >                'name'=>'(.*)',
> >                'id' => '[0-9]+'
> >        )
> > );
>
> > Except for the fact that I cannot get my pagination URL's to properly
> > display for this custom route. I have the following set up for my
> > pagination options url:
>
> > $paginator->options(
> >        array(
> >                'url' => array(
> >                        'controller'=>'catgories',
> >                        'action'=>'view',
> >                        
> > 'name'=>$html->slugify($category['Category']['name']),
> >                        'id'=>$category['Category']['id']
> >                )
> >        )
> > );
>
> > Which displays the URL's like "http://www.localhost.com/categories/
> > view/7/page:2/name:pcs", instead of "http://www.localhost.com/pcs-7/
> > page:2".
>
> > Any help is appreciated. Thanks!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Custom Route Pagination URLs

2009-02-25 Thread xxkylexx

That was how I initially had it set up prior to the custom route,
which worked fine. However, that method returns the same type of
results I get from the set-up originally described.

On Feb 25, 12:27 pm, brian  wrote:
> Try
>
> $paginator->options(
>         array('url' => $this->passedArgs)
> );
>
> On Tue, Feb 24, 2009 at 11:48 PM, xxkylexx  wrote:
>
> > Hey guys,
> > I can't seem to get this to work :-( . I currently have the following
> > route set up for my categories pages, which works great:
>
> > //Categories page route 
> > (example:http://www.mydomain.com/category_name_here-id)
> > Router::connect('/:name-:id',
> >        array(
> >                'controller' => 'categories',
> >                'action' => 'view'
> >        ),
> >        array(
> >                'name'=>'(.*)',
> >                'id' => '[0-9]+'
> >        )
> > );
>
> > Except for the fact that I cannot get my pagination URL's to properly
> > display for this custom route. I have the following set up for my
> > pagination options url:
>
> > $paginator->options(
> >        array(
> >                'url' => array(
> >                        'controller'=>'catgories',
> >                        'action'=>'view',
> >                        
> > 'name'=>$html->slugify($category['Category']['name']),
> >                        'id'=>$category['Category']['id']
> >                )
> >        )
> > );
>
> > Which displays the URL's like "http://www.localhost.com/categories/
> > view/7/page:2/name:pcs", instead of "http://www.localhost.com/pcs-7/
> > page:2".
>
> > Any help is appreciated. Thanks!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Custom Route Pagination URLs

2009-02-25 Thread brian

Try

$paginator->options(
array('url' => $this->passedArgs)
);

On Tue, Feb 24, 2009 at 11:48 PM, xxkylexx  wrote:
>
> Hey guys,
> I can't seem to get this to work :-( . I currently have the following
> route set up for my categories pages, which works great:
>
> //Categories page route (example: 
> http://www.mydomain.com/category_name_here-id)
> Router::connect('/:name-:id',
>        array(
>                'controller' => 'categories',
>                'action' => 'view'
>        ),
>        array(
>                'name'=>'(.*)',
>                'id' => '[0-9]+'
>        )
> );
>
> Except for the fact that I cannot get my pagination URL's to properly
> display for this custom route. I have the following set up for my
> pagination options url:
>
> $paginator->options(
>        array(
>                'url' => array(
>                        'controller'=>'catgories',
>                        'action'=>'view',
>                        'name'=>$html->slugify($category['Category']['name']),
>                        'id'=>$category['Category']['id']
>                )
>        )
> );
>
> Which displays the URL's like "http://www.localhost.com/categories/
> view/7/page:2/name:pcs", instead of "http://www.localhost.com/pcs-7/
> page:2".
>
> Any help is appreciated. Thanks!
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Custom Route Pagination URLs

2009-02-24 Thread Miles J

Try the bottom part here: http://book.cakephp.org/view/166/Pagination-in-Views

I too am having the same problem. Even if I pass the correct url vars
to paginator, the urls aren't routed.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---