|
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 |
FrankS Smarty n00b
Joined: 14 Aug 2012 Posts: 2
|
Posted: Tue Aug 14, 2012 9:33 am Post subject: Mit Variablen innerhalb des Templates arbeiten |
|
|
Hallo zusammen,
ich habe ein Template in dem in 2 verschachtelten Schleifen Array-Inhalte ausgegeben werden. Für das Template ist das aber ungünstig.
Kann ich, ohne dass ich in den PHP Dateien etwas ändere direkt in der Template Datei mit den Variablen arbeiten?
Ich möchte zB. temporär ein neues Array erstellen, was ich dann in einer neuen Schleife ausgeben kann.
Ich habe mir das Array einmal ausgeben lassen mit {$daten|@print_r}.
Kann ich innerhalb einer Schleife soetwas machen wie hier im PHP mit Smarty-Variablen?
$temp[] = $daten[$i][0];
Danke schon mal für die Hilfe.
VG Frank |
|
Back to top |
|
Grizzly Smarty Pro
Joined: 15 Apr 2011 Posts: 172 Location: Germany
|
Posted: Tue Aug 21, 2012 7:36 pm Post subject: |
|
|
Du kannst in Smarty mit assign etwas zuweisen, allerdings bringt es dir in einer Schleife ja nichts, da du dann als wert der temp-Variable immer array[lertzeIndex][0] hast... |
|
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
|