开发者

How to populate select box with the session values in CakePHP

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜