Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. EvenTest.php

function EvenTest::compile

Overrides TestExpression::compile

File

vendor/twig/twig/src/Node/Expression/Test/EvenTest.php, line 26

Class

EvenTest
Checks if a number is even.

Namespace

Twig\Node\Expression\Test

Code

public function compile(Compiler $compiler) : void {
    $compiler->raw('(')
        ->subcompile($this->getNode('node'))
        ->raw(' % 2 == 0')
        ->raw(')');
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal