4. Twig Helpers

4.1. sonata_flashmessages_get, sonata_flashmessages_types and sonata_flashmessages_class

See Flash Messages for more information.

4.2. sonata_urlsafeid

Gets the identifiers of the object as a string that is safe to use in an url.

4.3. sonata_template_deprecate

Node that can be used to deprecate a template. You have to provide a string that represents a new template and this argument is mandatory.

1
{% sonata_template_deprecate 'new_template.html.twig' %}

Triggers deprecation with a message:

The "current_template.html.twig" template is deprecated. Use "new_template.html.twig" instead.

In this example we used {% sonata_template_deprecate 'new_template.html.twig' %} inside of current_template.html.twig template.