class Twig_Node_Expression_Test_Divisibleby in Translation template extractor 6.3
Same name and namespace in other branches
- 7.3 vendor/Twig/Node/Expression/Test/Divisibleby.php \Twig_Node_Expression_Test_Divisibleby
Checks if a variable is divisible by a number.
<pre> {% if loop.index is divisible by(3) %} </pre>
@author Fabien Potencier <fabien@symfony.com>
Hierarchy
- class \Twig_Node implements Twig_NodeInterface
- class \Twig_Node_Expression
Expanded class hierarchy of Twig_Node_Expression_Test_Divisibleby
1 string reference to 'Twig_Node_Expression_Test_Divisibleby'
- Twig_Extension_Core::getTests in vendor/
Twig/ Extension/ Core.php - Returns a list of tests to add to the existing list.
File
- vendor/
Twig/ Node/ Expression/ Test/ Divisibleby.php, line 21
View source
class Twig_Node_Expression_Test_Divisibleby extends Twig_Node_Expression_Test {
public function compile(Twig_Compiler $compiler) {
$compiler
->raw('(0 == ')
->subcompile($this
->getNode('node'))
->raw(' % ')
->subcompile($this
->getNode('arguments')
->getNode(0))
->raw(')');
}
}