App: manual - Page: fragments/expressions_24
App: manual - Page: fragments/expressions_28
App: manual - Page: fragments/expressions_29
PHP
|
HTML
fragments/expressions_29.pad
|
Result
|
|
{data 'orders'} [ {"nr": 1, "state": "paid", "customer": "Ada"}, {"nr": 2, "state": "cancelled", "customer": "Alan"}, {"nr": 3, "state": "sent", "customer": "Bob"}, {"nr": 4, "state": "sent", "customer": "Alice"} ] {/data} {orders where='$state not in ("cancelled", "refunded") and $customer like "A%"'} <p>{$nr}: {$customer}, {$state}</p> {/orders}
|
|
App: regression/framework - Page: expressions/a_not_between_a_value_and_its_test_denies_the_test
PHP
|
HTML
expressions/a_not_between_a_value_and_its_test_denies_the_test.pad
|
Result
|
|
{data 'rows'}[{"s":"a"},{"s":"b"},{"s":"c"}]{/data}{rows where='$s not in ("a", "b")'}{$s}{/rows}|{rows where='$s not like "a%"'}{$s}{/rows}|{if 5 not in (5, 6)}T{else}F{/if}|{rows}{if $s ne 'a' and $s not in ('b')}{$s}{/if}{/rows}|{rows}{if $s not matches '/^[ab]$/'}{$s}{/if}{/rows}|{if 5 not range (1, 4)}T{else}F{/if}|{if not 5 in (1)}T{else}F{/if}
|
|
App: regression/framework - Page: expressions/a_test_after_a_function_without_brackets_tests_its_answer
PHP
|
HTML
expressions/a_test_after_a_function_without_brackets_tests_its_answer.pad
|
Result
|
|
[{echo 'Hello' | lower in ('hello')}][{echo 'Hello' | lower in ('x')}][{echo 'abc' | php:strlen in (3)}][{echo 'ab ' | trim like 'ab'}]
|
|
App: regression/framework - Page: expressions/a_typed_reference_before_an_infix_test_is_its_input
PHP
|
HTML
expressions/a_typed_reference_before_an_infix_test_is_its_input.pad
|
Result
|
|
{set $n = 3/}{set $s = 'hello'/}[{if field:n in (4, 5)}y{else}n{/if}][{echo field:n in (1, 2, 3)}][{echo field:n not in (1, 2)}][{echo field:s like 'h%'}][{echo constant:PHP_INT_SIZE in (4, 8)}]
|
|
App: regression/framework - Page: expressions/an_infix_test_as_an_argument_of_a_call_is_that_argument
PHP
|
HTML
expressions/an_infix_test_as_an_argument_of_a_call_is_that_argument.pad
|
Result
|
|
{set $n = 3}{set $s = 'ab'}[{echo php:var_export($n in (5), 1)}][{echo php:strval($n in (3))}][{echo php:max(1, $n + 1 in (4))}][{echo php:var_export($n not in (5), 1)}][{echo php:var_export(php:substr($s, 0, 1) like 'a%', 1)}][{echo php:str_repeat('x', $n in (3) ? 2 : 1)}][{echo $s | replace('a', $n in (3))}][{echo php:max(php:min(4, 9), $n range (1, 5))}][{echo php:max(1, in (3))}]
|
|
App: regression/framework - Page: expressions/an_infix_test_takes_the_whole_arithmetic_on_its_left
PHP
|
HTML
expressions/an_infix_test_takes_the_whole_arithmetic_on_its_left.pad
|
Result
|
|
{set $n = 3}{set $p = 10}{set $q = 3}{set $s = 'ab'}[{if $n + 1 range (9, 9)}T{else}F{/if}][{echo $n + 1 range (4, 4)}][{if $p * $q in (30)}T{else}F{/if}][{if $s . 'c' like 'abc'}T{else}F{/if}][{if -$n in (-3)}T{else}F{/if}][{if $n + 1 not in (4)}T{else}F{/if}][{if upper($s) in ('AB')}T{else}F{/if}][{echo $n | * 2 in (6)}][{if $n eq 3 and $n + 1 in (4)}T{else}F{/if}][{if not $n + 1 in (4)}T{else}F{/if}]
|
|
App: regression/framework - Page: functions/like_anchored_at_the_front
PHP
|
HTML
functions/like_anchored_at_the_front.pad
|
Result
|
|
{echo 'abc' | like('a%')}
|
|
App: regression/framework - Page: functions/like_counts_characters_not_bytes
PHP
|
HTML
functions/like_counts_characters_not_bytes.pad
|
Result
|
|
{echo 'é' | like('_')}
|
|
App: regression/framework - Page: functions/like_ignores_case
PHP
|
HTML
functions/like_ignores_case.pad
|
Result
|
|
{echo 'TEST.TXT' | like('%.txt')}
|
|
App: regression/framework - Page: functions/like_is_anchored_at_both_ends
PHP
|
HTML
functions/like_is_anchored_at_both_ends.pad
|
Result
|
|
{echo 'test1234' | like('test___')}
|
|
App: regression/framework - Page: functions/like_reaches_across_a_newline
PHP
functions/like_reaches_across_a_newline.php
|
HTML
functions/like_reaches_across_a_newline.pad
|
Result
|
<?php
$likeTwo = "first line\nsecond line";
?>
|
[{$likeTwo | like('first%%')}] [{$likeTwo | like('first line')}]
|
|
App: regression/framework - Page: functions/like_that_does_not_match
PHP
|
HTML
functions/like_that_does_not_match.pad
|
Result
|
|
{echo 'test.doc' | like('%.txt')}
|
|
App: regression/framework - Page: functions/like_with_a_percent_wildcard
PHP
|
HTML
functions/like_with_a_percent_wildcard.pad
|
Result
|
|
{echo 'test.txt' | like('%.txt')}
|
|
|