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

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -