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

Breadcrumb

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

function DivisiblebyTest::compile

Overrides TestExpression::compile

File

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

Class

DivisiblebyTest
Checks if a variable is divisible by a number.

Namespace

Twig\Node\Expression\Test

Code

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

API Navigation

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