Hi,
I’m having a few issues trying to figure out the following, even reading the documentation it makes little sense…
I’ve creating the following 2 tables
partners - id - partner_type_id (partner_types id) FK
partner_types - id - partner_type
generated the code using cake bake all Partners
generated the code using cake bake all PartnerTypes
on the add, edit form for the partner the dropdown only displays the ID from the partner_type table how do I get it to display partner_type with value of id??
Thanks @dreamingmind that worked
I amended this line in my Controller $partnerTypes = $this->Partners->PartnerTypes->find('list', ['keyField' => 'id', 'valueField' => 'partner_type']);
so it is now displaying the options correctly, only thing is how do I add <option> Select Option</option> to the start of the drop down??
'empty' => 'Select Option' in the array that you pass to the input (or control method). Not the array of choices that you pass in the 'options' key… Like:
I’m now struggling with another bit of code which I can’t get my head around how to write so it doesn’t throw an error…
I have several tables using the id from the partner table as a FK I’ve managed to get slug working, but now I have done this the data isn’t displaying on the view page for the other table data how do I write the following to get them to display??