PHP Classes

File: libs/Twig/test/Twig/Tests/Fixtures/expressions/ternary_operator.test

Recommend this page to a friend!
  Classes of william amed   Raptor 2   libs/Twig/test/Twig/Tests/Fixtures/expressions/ternary_operator.test   Download  
File: libs/Twig/test/Twig/Tests/Fixtures/expressions/ternary_operator.test
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Raptor 2
Framework that takes routes from annotations
Author: By
Last change:
Date: 8 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