Twig sort array of objects by field

后端 未结 8 2113
感动是毒
感动是毒 2020-12-17 09:31

I have entity with fields:

User

  • name
  • lastname
  • age

and few more. Im sending to Twig array with objec

8条回答
  •  萌比男神i
    2020-12-17 09:51

    You must do this in your model using an "Order by" clause. However, if you want to have a table that can be sorted dynamically, you should watch about the jQuery tablesorter plugin (or equivalent if you do not want to use jQuery).

    http://tablesorter.com/docs/

提交回复
热议问题