ajaxCRUD.com
» a PHP class to create / read / update / delete from a database table using AJAX
by loud canvas mediaAjaxCRUD API Reference
|
<< Reference overview << Home Object: ajaxCRUDConstructorFunctions
Variables |
formatFieldWithFunctionformat data in a column with a custom function
void formatFieldWithFunction( String fieldName, String functionName )
Use this function when you wish to format data in your table with a custom function. For example, you'd use this if you wanted to format money to always display looking like a currency.
The parameters of your custom function (which YOU define) must take in ONE argument ($data) and return your formated data. Details
Parameters
Example$tblDemo->formatFieldWithFunction('fldCarPrice', 'formatAsCurrency');
function formatAsCurrency($data){ return number_format($data, 2, '.', ','); } See also |
"Very interesting class. Thanks a lot."
~gustavo
