first, I am very new to cakephp.

I have 2 tables "categories" and "products"

I want to make a menu like category->product tree

in the view,  i use those code to display the categories:

<ul>
<?php foreach($categories as $category): ?>
<li>
<?php echo $category['Category']['name']; ?>
</li>

<?php endforeach; ?>
</ul>

But if I want to add links to these categories

how can I use $html->link to achieve it?


$html->link('$category['Category']['name']',array
('controller'=>'Products','action'=>'view', $category['Products']
['id']));


but this line code goes error,

I know $html->link first parameter should be a string value, how can I
assign a variable ?


please help,thank you
--~--~---------~--~----~------------~-------~--~----~
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