mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-10 13:28:55 +00:00
[ticket/7580] Add test for IF {VAR} is defined in templates
http://tracker.phpbb.com/browse/PHPBB3-7580 This test demonstrates that is possible to test if a variable exists and then use it if it does, similar to using isset(), but in template/twig syntax. <!— IF {VAR} is defined —>{VAR}<!— ENDIF —> PHPBB3-7580
This commit is contained in:
parent
f9438bcbf7
commit
d8c1c7fb9a
2 changed files with 11 additions and 0 deletions
|
@ -90,6 +90,13 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
|
||||||
array(),
|
array(),
|
||||||
'03!false',
|
'03!false',
|
||||||
),
|
),
|
||||||
|
array(
|
||||||
|
'if.html',
|
||||||
|
array('VALUE_TEST' => 'value'),
|
||||||
|
array(),
|
||||||
|
array(),
|
||||||
|
'03!falsevalue',
|
||||||
|
),
|
||||||
array(
|
array(
|
||||||
'loop.html',
|
'loop.html',
|
||||||
array(),
|
array(),
|
||||||
|
|
|
@ -19,3 +19,7 @@ false
|
||||||
<!-- IF S_TEST !== false -->
|
<!-- IF S_TEST !== false -->
|
||||||
!false
|
!false
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
|
|
||||||
|
<!-- IF VALUE_TEST is defined -->
|
||||||
|
{VALUE_TEST}
|
||||||
|
<!-- ENDIF -->
|
||||||
|
|
Loading…
Add table
Reference in a new issue