Hi All,

I hope someone can help me with what I think is a simple question that
I just haven't wrapped my head round yet. (I'm new to CakePHP).

I want to create a link that requests the index action of my blog
(which is paginated), but at the same time passes it a condition, like
category_id=2 or something like that, so that I can have a list of
categories to the right of my blog index that reloads the page with
just that categories blogs. This seems like a straightforward idea to
me, but I don't seem to be able to get the syntax right. I can do
limits and orders but not conditions. Can anyone help me please?

Some examples:

This works:
$html->link($category_name,array('controller'=>'Blogs',
'action'=>'index', 'limit'=>2));

This doesn't work:
$html->link($category_name,array('controller'=>'Blogs',
'action'=>'index', 'conditions'=>'Blog.category_id=3'));

My controller code:
function index() {
        $this->Blog->recursive = 0;
        $this->set('blogs', $this->paginate());
}

Thanks for any advice in advance!
Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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