Please bear in my mind this isn't originally my code so it's not crystal clear to me and help is extremely welcome as I'm lost.
I want to display rows from another table, but I'm facing some issues. When I use
in controller :
$companies = $this->Users->Companies->find('list');
in view
echo $this->Form->input('companies._ids',['options' =>$companies,'multiple'=>'checkbox']);?>
I get all of my Company's table ids and names in these basic checkboxes.
However, as I want to use every rows and not just id and name, I try using :
$companies = $this->Users->Companies->find('all');
but this triggers two problems : my datas are displayed in arrays like this :
{ "id": 2, "name": "Smith", "city": "Duisburg"}
and second problem : it skips the first row ! I have something with id 1, not showing when using find('all'), but showing when using find('list')
So how can I get every values and display them the way I want to ?