tags:

views:

20

answers:

1

Hi,

I have Event HABTM Category with categories_events table. I want to display only Event with given category_id. So since I have catId I don't need to go till Category model. I could dynamically bind hasMany association from Event to Cat_Event.

How do I set find() second parameter array to achieve this?

Thanks

+1  A: 

Try this way from EventsController:

$this->Event->Category->find('all', array(
    'conditions' => array('Category.id' => $catid)
));
bancer