|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
alouty Smarty Rookie
Joined: 07 Sep 2012 Posts: 8
|
Posted: Mon Oct 08, 2012 4:04 am Post subject: Sum given array |
|
|
<script type="text/javascript">
{stats type='applications' period='days' employer=$GLOBALS.current_user.username}
</script>
will output:
<script type="text/javascript">
0,0,0,6,0,0,0,0,405,47
</script>
I would like to know how to output sum of the array inside template file?
I haven't learn doing it in php file...
{php}
$val_arr = array(stats type='applications' period='days' employer=$GLOBALS.current_user.username);
{/php}
{assign var="val_arr1" value = $val_arr}
{$val_arr1|@array_sum} |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|