Reference - PAD functions - capitalize


App: manual - Page: callback/before
PHP
HTML
callback/before.pad
Result
<table border=1>

<tr>
<th>Name</th>
<th>Salary</th>
<th>Bonus</th>
<th>Total</th>
</tr>

{staff callback='before.php', before}

{first}
<tr>
<td>Totals</td>
<td>{$salaryTotal | %.2f}</td>
<td>{$bonusTotal | %.2f}</td>
<td>{$totalTotal | %.2f}</td>
</tr>
{/first}

<tr align="right" bgcolor="{switch 'yellow', 'pink'}">
<td align="left">{$name | capitalize}</td>
<td>{$salary | %.2f}</td>
<td>{$bonus | %.2f}</td>
<td>{$total | %.2f}</td>
</tr>

{/staff}

</table>


App: manual - Page: callback/demand
PHP
HTML
callback/demand.pad
Result
<table border=1>

<tr>
<th>Name</th>
<th>Salary</th>
<th>Bonus</th>
<th>Total</th>
</tr>

{staff callback='demand.php'}

<tr align="right"
bgcolor="{switch 'yellow', 'pink'}">
<td align="left">{$name | capitalize}</td>
<td>{$salary | %.2f}</td>
<td>{$bonus | %.2f}</td>
<td>{$total | %.2f}</td>
</tr>

{/staff}

<tr>
<td>Totals</td>
<td>{$salaryTotal | %.2f}</td>
<td>{$bonusTotal | %.2f}</td>
<td>{$totalTotal | %.2f}</td>
</tr>

</table>


App: regression/common - Page: misc/eval


App: regression/framework - Page: functions/capitalize
PHP
HTML
functions/capitalize.pad
Result
{echo 'hello world' | capitalize}


App: regression/framework - Page: functions/capitalize_keeps_a_value_with_a_broken_byte
PHP
functions/capitalize_keeps_a_value_with_a_broken_byte.php
HTML
functions/capitalize_keeps_a_value_with_a_broken_byte.pad
Result
<?php

$bad
= "ab\xC3 cd";

?>
[{$bad | capitalize}][{$bad | ucwords}][{$bad | upper}]


App: regression/framework - Page: functions/three_in_a_chain
PHP
HTML
functions/three_in_a_chain.pad
Result
{echo '  hello world  ' | trim | capitalize | cut(' ')}


App: regression/framework - Page: functions/upper_changes_an_accented_letter_too
PHP
HTML
functions/upper_changes_an_accented_letter_too.pad
Result
{echo 'café' | upper} {echo 'ÉCOLE' | lower} {echo 'éric de la cruz' | capitalize}