How to group values in an array in cakephp?

前端 未结 2 1845
一整个雨季
一整个雨季 2021-01-27 17:25

I have a list of teamleads in an array and their corresponding team members in another array.
I need to group them in an array such that under each teamleads the correspondi

2条回答
  •  借酒劲吻你
    2021-01-27 18:08

    Follow the conventions of CakePHP and you won't have this problem.

    If you query TeamLead->find() and TeamLead hasAndBelongsToMany or hasMany TeamMember the returned array structure will contain everything you need and in a fashion you can use with the FormHelper methods in the views.

提交回复
热议问题