In my Project I have items table this contain two foreign Keys locations_id and categories_id. When i add new item, cateogries_id appear categories.name
in add.ctp : select options (foreign) Key is display Id.
I want to appear at location select option locations.city field from location table.
this is used by cake bake command to my all tables.!
Thanks
\src\Model\Table\LocationsTable.php
Change Display Field. this is show Id ..
now Change
$this->displayField('id');
To $this->displayField('name');
/*name is your field in you table you want to display