CakePHP 2.1.1 foreach
问题 In my view I want a HTML table something like this: COUNTRY TOWN france paris This is my query: $foo=$this->country->find('all', array( 'contain' => array( 'Town' => array( 'conditions' => array("Town.country_id = country.id"), 'fields' => array('id','name') ) ) ) ); I want to display to my view like this: line6 <?php foreach ($diponibilite as $f): ?> line7 line8 <tr> line9 <td><?php echo $f['country']['name'];?></td> line10 <td><?php echo $f['town']['name'];?></td> line11 line12 </tr> line13