Load Record by ID for View CakePHP 3 -
i have basic question. have column in computer record id of customer owns computer. trying show name in table next computers' , found temporary solution. using in view (which isn't proper mvc) , makes page take forever load (i showing 100 computers per page).
<td> <?php foreach ($customers $customer): if ($computer->cust_id == $customer->id) { echo $this->html->link( $customer->first.' '.$customer->last, ['controller'=>'customers', 'action'=>'view', $customer->id] ); } endforeach; ?> </td>
i tried $this->customers->get($computer->cust_id)
after loading model in controller says need customer helper. cakephp method of taking care of issue?
thanks!
Comments
Post a Comment