On Sun, Dec 19, 2010 at 5:36 AM, Cruisine <cruisin...@yahoo.co.id> wrote: > i'm sorry.perhaps i couldn't mention the prolem properly because of my > english is very bad. > actually i know how to make the hbtm table. and i've done with the > table. what i actually want is i want to make HTML table which only > show one "Name" (from 2 similar name)....so it could be more user > friendly than i provide 2 same name. > i only want to show a display in my browser like this : > ================== > name requirements > ----------------------------------- > | visa > sam --------------------- > | passport > ---------------------------------- > > rather than: > ================= > name requirments > --------------------------------- > sam | visa > --------------------------------- > sam | passport > -------------------------------- > > so, i only ask about methodology to make a display like that. not in > databse but in cakephp view.
What are the models and associations involved? And what does the data look like now? Try adding debug($data) in your view (or whatever your data variable is called). If you do a find() or paginate() on Person (or whatever the model is) you should get an array like: array( 0 => array( 'Person' => array( 'name' => ... ... ), 'Requirement' => array( 0 => array( 'name' => 'Visa', ... ), 1 => array( 'name' => 'Passport', ... ) ) ), 1 => array( 'Person' => array( 'name' => ... ... ), 'Requirement' => array( 0 => array( 'name' => 'Visa', ... ), 1 => array( 'name' => 'Passport', ... ) ) ) ); I'm assuming you have a model Requirement with a 'name' field. In the view: foreach ($data as $d) { echo $d['Person']['name']; foreach ($d['Requirement'] as $requirement) { echo $requirement['name'] Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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