sulu_util_multisortΒΆ

Allows arrays of arrays or objects to be sorted by any properties which are accessible via. the Symfony PropertyAccessor path(s).

{% for content in content.smartcontent|sulu_util_multisort('[title]', 'asc') %}
    {# ... #}
{% endfor %}

You can specify an array of paths to enable cascading sorting, for example

{% for content in content.smartcontent|sulu_util_multisort(['[title]', '[description]'], 'asc') %}
    {# ... #}
{% endfor %}

Arguments:

  • path: Property path

  • direction: Direction to sort, either ASC or DESC