I have stored many employee objects in session. how to populate the select box with the name of the all employees.i am v开发者_StackOverflow社区ery new to cakephp so explain me the syntax.
Assuming that your employee objects in your session are in the following format
array('Employee.id' => 'Employee.name')
you can populate the selectbox with the following statement in your views: $this->Form->select('employees', $employees)
(where $employees is an array formatted as above).
See also http://book.cakephp.org/view/1430/select for more info on the syntax of the select box.
精彩评论