PHP Classes

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

Recommend this page to a friend!
  Classes of Duong Huynh Nghia   Lego PHP   Library/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ternary_operator.test   Download  
File: Library/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ternary_operator.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: 347 bytes
 

Contents

Class file image Download
--TEST-- Twig supports the ternary operator --TEMPLATE-- {{ 1 ? 'YES' : 'NO' }} {{ 0 ? 'YES' : 'NO' }} {{ 0 ? 'YES' : (1 ? 'YES1' : 'NO1') }} {{ 0 ? 'YES' : (0 ? 'YES1' : 'NO1') }} {{ 1 == 1 ? 'foo<br />':'' }} {{ foo ~ (bar ? ('-' ~ bar) : '') }} --DATA-- return array('foo' => 'foo', 'bar' => 'bar') --EXPECT-- YES NO YES1 NO1 foo<br /> foo-bar