Thanks, Jon, that's perfect.
-Original Message-
From: cake-php@googlegroups.com [mailto:cake-...@googlegroups.com] On Behalf Of
Jon Bennett
Sent: 14 January 2010 15:07
To: cake-php@googlegroups.com
Subject: Re: create a link with conditions to filter index action
hi Ben,
Used
hi Ben,
Used named parameters:
$html->link($category_name, array(
'controller'=>'Blogs',
'action'=>'index',
'category_id'=>3,
'tag_id'=>4
));
public function index()
{
extract($this->params['named']);
$conditions = array();
n habtm reference tables.
Thanks again for the advice.
-Original Message-
From: cake-php@googlegroups.com [mailto:cake-...@googlegroups.com] On Behalf
Of Jeremy Burns
Sent: 14 January 2010 14:20
To: cake-php@googlegroups.com
Subject: Re: create a link with conditions to filter index action
If
If you are only ever going to filter for category_id, you could do this:
> $html->link($category_name,array('controller'=>'Blogs',
> 'action'=>'index', 3));
Then change you index function to:
function index($category_id = null)
...and then check for a non null value later in your code when you d