Smarty – Template Easy

April 22nd, 2009 | by Drew |

Formatting is one of the hardest tasks to do with respect to cross-platform and scripting programs/pages. Smarty, one of the many PHP advocates has a complete line of products, from community-based ones to those aimed at more commercial purposes enabling the development of enterprise applications over the internet that are secure and powerful. Below, we see a sample of the use of their formatting, using their libraries that have been released to the many PHP users as their contribution to the community.

// smarty template snippet
...${$BIDS[thebid].bid|number_format:2:".":","}...

// modifier_number_format.php
function smarty_modifier_number_format($number, $decimals = false, $dec_point = false, $thousands_sep = false)
{
return number_format($number, $decimals, $dec_point, $thousands_sep);
}
?>

The sample code is a sample of how one can use their extensive libraries to deploy and present regional information allowing cross-platform and region deployment of applications.

Sorry, comments for this entry are closed at this time.