Reference - Data handling - left


App: manual - Page: miscellaneous/handling


App: regression/framework - Page: lenient/a_trim_count_that_is_no_number_takes_nothing_off
PHP
lenient/a_trim_count_that_is_no_number_takes_nothing_off.php
HTML
lenient/a_trim_count_that_is_no_number_takes_nothing_off.pad
Result
<?php

// The lenient walk under test: with the syntax check off, what cannot run passes the
// value through or yields empty, and the walk carries on.

$padCheckSyntax = FALSE;

?>
{sequence '1..6', trim, right='x'}{$sequence} {/sequence}|{sequence '1..6', trim, both=2.5, left=1}{$sequence} {/sequence}


App: regression/framework - Page: options/left_trims_only_the_front
PHP
HTML
options/left_trims_only_the_front.pad
Result
{data 'n'}
[1,2,3,4,5,6]
{/data}
{n trim=2, left}
{$n},
{/n}


App: regression/framework - Page: options/rows_keyed_by_number_keep_their_keys_under_every_handler
PHP
options/rows_keyed_by_number_keep_their_keys_under_every_handler.php
HTML
options/rows_keyed_by_number_keep_their_keys_under_every_handler.pad
Result
<?php

// A set keyed by id - the keys are part of the rows, {&key} names them - and a list, which
// stays a list: numbered from 0 again after the handler.

$ks = [ 10 => [ 'n' => 3 ], 20 => [ 'n' => 1 ], 30 => [ 'n' => 2 ] ];
$xs = [ 'a', 'b', 'c' ];

?>
first:[{ks first=2}{&key},{/ks}] last:[{ks last=2}{&key},{/ks}] reverse:[{ks reverse}{&key},{/ks}] sort:[{ks sort='n'}{&key},{/ks}] splice:[{ks splice='1|1'}{&key},{/ks}] trim:[{ks trim}{&key},{/ks}] left:[{ks trim, left}{&key},{/ks}] random:[{ks random=3, orderly}{&key},{/ks}] list:[{xs reverse}{&key}{$xs},{/xs}][{xs last=2}{&key}{$xs},{/xs}][{xs splice='0|1'}{&key}{$xs},{/xs}]


App: regression/framework - Page: sequence/trim_0_on_the_left_takes_nothing_off
PHP
HTML
sequence/trim_0_on_the_left_takes_nothing_off.pad
Result
{seqFixture trim=0, left}
{$seqFixture},
{/seqFixture}


App: regression/framework - Page: sequence/trim_left_only
PHP
HTML
sequence/trim_left_only.pad
Result
{sequence '1..10', push='nums'/}
{pull:nums trim, left=8}
{$sequence},
{/pull:nums}


App: regression/framework - Page: sequence/trim_on_the_left_only
PHP
HTML
sequence/trim_on_the_left_only.pad
Result
{seqFixture trim=2, left}
{$seqFixture},
{/seqFixture}


App: regression/framework - Page: sequence/trim_value_fills_both_then_left_adds
PHP
HTML
sequence/trim_value_fills_both_then_left_adds.pad
Result
{sequence '1..10', push='nums'/}
{pull:nums trim=2, left=3}
{$sequence},
{/pull:nums}


App: sequence - Page: specials/trim