Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

how to parse multidimensional Arrays?

 
Post new topic   Reply to topic    Smarty Forum Index -> Smarty Development
View previous topic :: View next topic  
Author Message
SunboX
Smarty n00b


Joined: 20 Oct 2004
Posts: 2

PostPosted: Wed Oct 20, 2004 8:58 am    Post subject: how to parse multidimensional Arrays? Reply with quote

Hi, (sry for my english, i┤m german)

Can someone tell me, how to parse this Array?

Code:

{$result} Array (23)
0 => Array (2)
  letter => A
  abkuerzungen => Array (16)
    0 => Array (3)
      short => AA
      long => Asynchronous Allocation
      desc => empty
    1 => Array (3)
      short => A├ťE
      long => Anfangs├╝bertragungseinrichtung
      desc => engl. CE
    2 => Array (3)
      short => AC
      long => Authentication Center
      desc => empty
    3 => Array (3)
      short => ACF
      long => Access Control Field
      desc => empty
    4 => Array (3)
      short => ACU
      long => Automatic Calling Unit
      desc => empty
    5 => Array (3)
      short => ADSL
      long => Asymmetric Digital Subscriber Line
      desc => empty
    6 => Array (3)
      short => AP
      long => Access Point
      desc => empty
    7 => Array (3)
      short => APE
      long => Au├čenliegende perifere Einrichtung
      desc => empty
    8 => Array (3)
      short => ARP
      long => Address Resolution Protocol
      desc => empty
    9 => Array (3)
      short => ASCII
      long => American Standard Code for Informatio...
      desc => empty
    10 => Array (3)
      short => ASK
      long => Amplitude Shift Key
      desc => empty
    11 => Array (3)
      short => ASN
      long => Application Program Interface
      desc => empty
    12 => Array (3)
      short => ASN
      long => Abstract Syntax Notation
      desc => Autonomous System Number
    13 => Array (3)
      short => ATM
      long => Asynchroner Transfermodus
      desc => empty
    14 => Array (3)
      short => AVST
      long => Auslandsvermittlungsstelle
      desc => empty
    15 => Array (3)
      short => AWS
      long => Anrufweiterschaltung
      desc => empty
1 => Array (2)
  letter => B
  abkuerzungen => Array (9)
    0 => Array (3)
      short => B-ISDN
      long => Breitband-ISDN
      desc => empty
 
.....


here┤s the template part:

Code:

<!-- section name=result loop=$result -->
<p>&</p>
<p class="Stil4" name="<!-- $result[result].letter -->">[<!-- $result[result].letter -->]</p>
<table width="100%"  border="1" cellspacing="0" cellpadding="3">
  <tr bgcolor="#9999FF">
    <th><span class="Stil8">Abk&rzung</span></th>
    <th><span class="Stil8">Ausgeschrieben</span></th>
    <th><span class="Stil8">Beschreibung</span></th>
  </tr>
<!-- section name=abkuerzung loop=$result[result].abkuerzungen -->
  <tr name="">
    <td>
      <input type="checkbox" name="" value="checkbox">
      <input name="" type="text" value="<!-- $result[result][abkuerzung].short --> <-- * DOESN┤T FIT * -->" size="20"></td>
    <td>
      <input name="" type="text" value="" size="40"></td>
    <td>
      <input name="" type="text" value="" size="40"></td>
  </tr>
<!-- /section -->
</table>
<p class="Stil5"><a href="#top">[<span class="Stil7">^</span>] nach oben</a> </p>
<!-- /section -->


thanx SunboX

PS:

Code:

$smarty->left_delimiter = '<!-- ';
$smarty->right_delimiter = ' -->';
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Smarty Development All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP