Documentation » Core

7. Doctrine base entity manager »

« 5. Flash Messages

6. Twig Helpers

6.1. sonata_slugify (deprecated)

This filter is deprecated. Install cocur/slugify and enable CocurSlugifyBundle for using slugify filter.

Create a slug from a string:

{{ "my string"|sonata_slugify }}

Results in


6.2. sonata_flashmessages_get and sonata_flashmessages_types

See Flash Messages for more information.

6.3. sonata_urlsafeid

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

6.4. 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.

{% 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.

Found a typo? Something is wrong in this documentation? Just fork and edit it!