Cakephp : display data in a table with other table's data
问题 I'm displaying my users in a table, and I am retrieving the company name and city with company_id users : id lastname firstname company_id role 1 doe john 2 author 2 deo jenne 2 admin 3 deus Joe 1 admin 4 Stewart Rob 1 author companies : id name city 1 New-York Company New-York 2 Paris Company Paris user display : <?php foreach($users as $user):?> <tr> <td><?= $user->lastname?></td> <td><?= $user->firstname?></td> <td><?= $user->companies->name ?></td> <td><?= $user->companies->city?></td>