Skip to content

Commit b858383

Browse files
committed
[Twig] [twig reference] add examples to functions (format_file, file_exercp, fragment_uri, controller, csrf_token)
1 parent 3dadb0d commit b858383

File tree

1 file changed

+0
-27
lines changed

1 file changed

+0
-27
lines changed

reference/twig_reference.rst

-27
Original file line numberDiff line numberDiff line change
@@ -81,33 +81,6 @@ Generates the URI of :ref:`a fragment <fragments-path-config>`.
8181
.. versionadded:: 5.3
8282

8383
The ``fragment_uri()`` function was introduced in Symfony 5.3.
84-
Example 1
85-
86-
.. code-block:: twig
87-
88-
{{ fragment_uri(controller('App\\Controller\\HomeController::index'), absolute = true, strict = true, sign = true) }}
89-
90-
Output:
91-
92-
.. code-block:: html
93-
94-
<a href="https://example.com/_fragment?_path=_controller=App%5CController%5CHomeController%3A%3Aindex&_hash=abcdef123456">
95-
https://example.com/_fragment?_path=_controller=App%5CController%5CHomeController%3A%3Aindex&_hash=abcdef123456
96-
</a>
97-
98-
Example 2
99-
100-
.. code-block:: twig
101-
102-
{{ fragment_uri(controller('App\\Controller\\UserController::profile', { 'id': 42 }), absolute = false, strict = false, sign = false) }}
103-
104-
Output:
105-
106-
.. code-block:: html
107-
108-
<a href="/_fragment?_path=_controller=App%5CController%5CUserController%3A%3Aprofile&id=42">
109-
/_fragment?_path=_controller=App%5CController%5CUserController%3A%3Aprofile&id=42
110-
</a>
11184

11285
controller
11386
~~~~~~~~~~

0 commit comments

Comments
 (0)