How to populate select box with the session values in CakePHP -


I have stored multiple employee objects in the session, how to populate the selection box with the names of all the employees. I am very new to the KPP, so let me explain the syntax.

Assuming that your employees 'objects are in the following format in your session array (' Employee .id '= & gt;' Employee.name ') You can populate the selectbox with the following statement in your thoughts: $ this-> Form- & gt; Select ('employee', $ employees) (where $ employee is formatted as an array formatted above)

See also for more information on the syntax of the Selection box.

Comments