How to show values in (related records from other tables) instead of IDs


#1


Greetings,
i’m new to cakephp, and i used the cake bake with cakphp naming conversion , now in the generated part of related table (like in the photo attached)
how to display the values instead of IDs in the view.ctp.
I already set setDisplayedField() in each table class
ER model :
Reservation hasMany payement,
Payments hasMany PaymentMethods
Reservation hasMany Rooms
Rooms hasMany FoodPlan
thanks in advance…


#2

In the view you will see a row loop:

Something like: h($variable->payment_method_id); Change the payment method Id with the column name in the table that calls out the name.

h($variable->related table name -> the column) change the column name from the id column to the column that contains the view name you want displayed. .