ispCP - Board - Support
How to add Array in template file? - Printable Version

+- ispCP - Board - Support (http://www.isp-control.net/forum)
+-- Forum: ispCP Omega Development Area (/forum-1.html)
+--- Forum: General discussion (/forum-11.html)
+--- Thread: How to add Array in template file? (/thread-12533.html)



How to add Array in template file? - max - 12-27-2010 05:06 AM

Hello I work on new improvement about billing in ISPcp.
The work I'll show, when it's done.
The question is:
Is possible to output orderpanel with custom array length?
How can I write this php code in .tpl?
PHP Code:
<?php
$domain
=Array();
$domain["com"]=Array("20","$","month");
$domain["eu"]=Array("21","Euro","month");
...
?>
<?php 
foreach($domain as $item => $value) { ?>        
        <tr>
            <td class="content"><img src="../images/domain.png" alt="<?php echo $item?>" />&nbsp;&nbsp;<?php echo $item?></td>
            <td class="content"><?php echo $value[0]." ".$value[1]."/".$value[2]; ?></td>
        </tr>
<?php ?>



RE: How to add Array in template file? - RatS - 12-31-2010 11:16 PM

PHP Code in templates i not interpeted. You cannot use it there.
You better check the listings of e.g. Traffic or User and try to understand, how <!-- BDP --> and <!-- EDP --> works.


RE: How to add Array in template file? - ephigenie - 01-07-2011 12:08 AM

And now everything will be better ... just take a look at the smarty manual Smile

http://www.smarty.net

... because we're switching from pTemplate to Smarty


RE: How to add Array in template file? - Albina9Ward - 01-29-2011 03:25 PM

Is there any way to use or add array in array... its possible or not in PHP...