Current time: 11-27-2024, 11:38 AM Hello There, Guest! (LoginRegister)


Post Reply 
How to add Array in template file?
Author Message
max Offline
Junior Member
*

Posts: 17
Joined: Dec 2010
Reputation: 0
Post: #1
Question How to add Array in template file?
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 ?>
12-27-2010 05:06 AM
Visit this user's website Find all posts by this user Quote this message in a reply
RatS Offline
Project Leader
******

Posts: 1,854
Joined: Oct 2006
Reputation: 17
Post: #2
RE: How to add Array in template file?
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.
12-31-2010 11:16 PM
Visit this user's website Find all posts by this user Quote this message in a reply
ephigenie Offline
Project Leader
*******
Administrators

Posts: 1,578
Joined: Oct 2006
Reputation: 15
Post: #3
RE: How to add Array in template file?
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
01-07-2011 12:08 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Albina9Ward Offline


Posts: 1
Joined: Jan 2011
Reputation: 0
Post: #4
RE: How to add Array in template file?
Is there any way to use or add array in array... its possible or not in PHP...
01-29-2011 03:25 PM
Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)