In order to create a proper link with HtmlHelper, you'd need to do:

echo $html->link(
        'whatever',
        array(
                'controller' => 'posts',
                'action' => 'category_view',
                'username' => $user_name,
                'categoryslug' => $category_slug
        )
);

So, for PaginatorHelper, you need to pass both username &
categoryslug. Are they present in $this->passedArgs on the first page?
Try debugging that.

Also, you could drop the word 'category' from the URL by doing:

Router::connect(
        '/blog/:username/:categoryslug',
        array('controller' => 'posts', 'action' => 'category_view'),
        array(
                'pass' => array('username', 'categoryslug'),
                'username' => '[0-9a-zA-Z]+',
                'categoryslug' => '[a-z0-9]+'
        )
);

Do your category slugs not have dashes or underscores, btw?

On Sun, Aug 2, 2009 at 6:38 PM, b1065...@tyldd.com<b1065...@tyldd.com> wrote:
>
> hi there,
>
> i am building blog platform where users can have blogs with cakephp. i
> have Posts controller.
>
> i have defined following route:
>
> Router::connect(
>                '/blog/:username/category/:categoryslug',
>                array('controller' => 'posts', 'action' => 'category_view'),
>                array(
>                        'pass' => array('username', 'categoryslug'),
>                        'username' => '[0-9a-zA-Z]+',
>                        'categoryslug' => '[a-z0-9]+'
>                )
>        );
>
> also inside category_view.ctp view file i have above at the begining:
>
> $paginator->options( array('url' => $this->passedArgs ));
>
> unfortunatelly my pagination links look like following:
>
> http://www.sample.com/posts/category_view/ADMIn/php/page:2
>
> instead of:
>
> http://www.sample.com/blog/ADMIn/category/php/page:2
>
> any ideas what could be wrong ????
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to