Set the sub-category in the controller:

$this->set('sub_category', ...

then, in your element:

$this->requestAction("category/index/${sub_category}");

However, I'm not certain that I understand what you want to do, so there may
be a better way to achieve your goal. Specifically, I don't understand why
you want to call the index() method here. If you use the above example, your
method will expect a parameter for sub_category. For example:

$this->requestAction("category/foo/${sub_category}");

In the controller:

function foo($bar)
{
    return $bar;
}



On Thu, Nov 13, 2008 at 11:50 PM, jet wong <[EMAIL PROTECTED]> wrote:

>
> I want to show the subcategory in every product page,so I  create a
> element to do this,but I found the only method to get data is
> requestAction, for example  I use $this->requestAction('category/
> index/
> mp3') to get the mp3 category, my question is how to change the param
> 'mp3' to 'cd',Passing from controller?
> please give some advice,I'm very thankful.sorry for my poor english.
>
> >
>

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

Reply via email to