0

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 My Project Sample image clear!

Ye Htun Z
  • 2,079
  • 4
  • 20
  • 31
  • **http://book.cakephp.org/3.0/en/orm/retrieving-data-and-resultsets.html#finding-key-value-pairs** – ndm Jan 24 '15 at 12:49

1 Answers1

1

\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
enter image description here

Ye Htun Z
  • 2,079
  • 4
  • 20
  • 31