Rules for working with Twig
Copy the link to the article
Copied

Twig-templates are used for preparing of printed forms, letters, SMS templates and notifications. They look like HTML-layout with inclusions of twig-markup, so that it is needed basic knowledge of html and twig for creating templates. As a rule, there are number of templates in the system, which you can use as a base.

Read also:

In twig there are following basic language constructions:

  • {{ ... }} — output of the variable value
  • {% ... %} — functional block
  • {# ... #} — comments

In the functional block are used language tags like {% tag %} ... {% endtag %}:

  • do — execute the random operation;
  • for — cycle organization;
  • set — set value of variable;
  • if — conditional operator, also can be used operator {% else %}.

The official twig documentation provides more detailed information about working with it.

Below there are reference book of по twig-filters, twig-functions and objects available in system templates.

Thank you for your feedback.
Was this article helpful?
No
  • Рекомендации не помогли
  • Нет ответа на мой вопрос
  • Текст трудно понять
  • Не нравится описанный функционал
Yes
Next article
Reference book of available twig-filters
In templates are available most part of standart filters and some special filters. Full list of available filters you may see in the article.
#}