Try this $this->set('data', $this->Product->Category->findAllThreaded(null, null, 'parent_id')); $CategoryArray = $this->Product->Category->generateList(null, 'parent_id'); $this->set('CategoryArray', $CategoryArray);
On Feb 2, 2008 1:47 PM, Rgarg <[EMAIL PROTECTED]> wrote: > > Hi!!!! > > i am using two controller > Products > categories > > in index page i want to display all information about products as well > as 'category name'.category name comes from Categories table. > > Model of Products is: > > <?php > class Product extends AppModel > { > var $name = 'Product'; > var $belongsTo = array ('Category' => array('className' => > 'Category','conditions'=>'','order'=>'', > 'foreignKey'=>'category_id')); > } > ?> > > > controller is: > > class ProductsController extends AppController > { > //var $scaffold; > var $name = 'Products'; > var $helpers = array('Html', 'Form', 'Tree' ); > var $components = array('Upload'); > > function index() { > $this->Product->recursive = 0; > $this->set('products', $this->Product->findAll()); > } > > > > in index() i want to use > > $this->set('data', $this->Category->findAllThreaded(null, null, > 'parent_id')); > $CategoryArray = $this->Category->generateList(null, > 'parent_id'); > $this->set('CategoryArray', $CategoryArray); > > Please help me............ > What to do for this. > > > > -- Thanks Anupom Trippert Inc. [http://www.trippert.com] GopherNow. [http://www.gophernow.com/] Homepage. [http://www.anupom.wordpress.com/] --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---