Tos Web Developer provides insights, tutorials, and advice around topics including content strategy, design, Drupal Development, Drupal Custom Module Development, Drupal 8 Custom themes, PHP, Server, Twig, and more



You can perform mathematical calculations on Twig variables using the same operators that are available in PHP. Examples include:
  • Addition {{ 1+1 }}
  • Subtraction {{ 4-2 }}
  • Division {{ 8/2 }}
  • Remainder {{ 11 % 5 }}
  • Multiplication {{ 5 * 5 }}
  • Exponentials {{ 2 ** 3 }} (2 to the power of 3)
There are other Twig features and functions that you can find at twig.sensiolabs.org/documentation.

No comments:

Post a Comment

| Designed And Blog Post by www.toswebdeveloper.com