8000 Update twig_reference.rst · symfony/symfony-docs@f67762d · GitHub
[go: up one dir, main page]

Skip to content

Commit f67762d

Browse files
raulcontixabbuh
authored andcommitted
Update twig_reference.rst
1 parent ff14308 commit f67762d

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

reference/twig_reference.rst

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -595,14 +595,16 @@ file_excerpt
595595

596596
.. code-block:: twig
597597
598-
{{ file|file_excerpt(line = null) }}
598+
{{ file|file_excerpt(line, srcContext = 3) }}
599599
600600
``file``
601601
**type**: ``string``
602-
``line`` *(optional)*
602+
``line``
603+
**type**: ``integer``
604+
``srcContext`` *(optional)*
603605
**type**: ``integer``
604606

605-
Generates an excerpt of seven lines around the given ``line``.
607+
Generates an excerpt of a code file around the given ``line`` number. An optional number of displayed lines can be passed.
606608

607609
format_file
608610
~~~~~~~~~~~
@@ -639,12 +641,14 @@ file_link
639641

640642
.. code-block:: twig
641643
642-
{{ file|file_link(line = null) }}
644+
{{ file|file_link(line) }}
643645
644-
``line`` *(optional)*
646+
``file``
647+
**type**: ``string``
648+
``line``
645649
**type**: ``integer``
646650

647-
Generates a link to the provided file (and optionally line number) using
651+
Generates a link to the provided file and line number using
648652
a preconfigured scheme.
649653

650654
.. _reference-twig-tags:

0 commit comments

Comments
 (0)
0