minor #4314 Clarify coding standards (fabpot)

This PR was merged into the 3.x branch.

Discussion
----------

Clarify coding standards

Refs #3545

Commits
-------

1dfdd82cfe Clarify coding standards
This commit is contained in:
Fabien Potencier
2024-09-14 10:29:17 +02:00
+9 -1
View File
@@ -88,13 +88,21 @@ standards:
[1, 2, 3]
{'name': 'Fabien'}
* Use lower cased and underscored variable names:
* Use snake case for all variable names (provided by the application and
created in templates):
.. code-block:: twig
{% set name = 'Fabien' %}
{% set first_name = 'Fabien' %}
* Use snake case for all function/filter/test names:
.. code-block:: twig
{{ 'Fabien Potencier'|to_lower_case }}
{{ generate_random_number() }}
* Indent your code inside tags (use the same indentation as the one used for
the target language of the rendered template):