PHP Classes

File: Library/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/unary_macro_arguments.test

Recommend this page to a friend!
  Classes of Duong Huynh Nghia   Lego PHP   Library/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/unary_macro_arguments.test   Download  
File: Library/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/unary_macro_arguments.test
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Lego PHP
Blog and shopping cart system
Author: By
Last change:
Date: 7 years ago
Size: 611 bytes
 

Contents

Class file image Download
--TEST-- Twig manages negative numbers as default parameters --TEMPLATE-- {% import _self as macros %} {{ macros.negative_number1() }} {{ macros.negative_number2() }} {{ macros.negative_number3() }} {{ macros.positive_number1() }} {{ macros.positive_number2() }} {% macro negative_number1(nb=-1) %}{{ nb }}{% endmacro %} {% macro negative_number2(nb = --1) %}{{ nb }}{% endmacro %} {% macro negative_number3(nb = - 1) %}{{ nb }}{% endmacro %} {% macro positive_number1(nb = +1) %}{{ nb }}{% endmacro %} {% macro positive_number2(nb = ++1) %}{{ nb }}{% endmacro %} --DATA-- return array() --EXPECT-- -1 1 -1 1 1