 |
Smarty
The discussions here are for Smarty, a template engine for the PHP programming language. Dedicated server web hosting provided by Guru-host.eu. |
| View previous topic :: View next topic |
| Author |
Message |
jacz Smarty Pro

Joined: 13 Nov 2010 Posts: 249
|
Posted: Thu Dec 15, 2011 3:05 pm Post subject: Kleines Zuweisungsproblem |
|
|
Das
{$sz=$size[3]}
<p> {dimage_sq image=$t style="$sz alt=\"Testbildchen\""}</p>
funktioniert
das
<p> {dimage_sq image=$t style="$size[3] alt=\"Testbildchen\""}</p>
ergibt statt dem Inhalt eine Ausgabe array. statt des darin enthaltenen Wertes. |
|
| Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 4177 Location: Hamburg / Germany
|
Posted: Fri Dec 16, 2011 2:30 pm Post subject: |
|
|
Ja. Smarty erkennt automatisch nur einfache Variablen wie $foo direct. Alles was dahinter steht ist text.
Wilst du eine Arry Element oder andere komplexere Dinge einfügen, so muss das ganz in Backticks oder {---}
.
Siehe auch http://www.smarty.net/docs/en/language.syntax.quotes.tpl |
|
| Back to top |
|
jacz Smarty Pro

Joined: 13 Nov 2010 Posts: 249
|
Posted: Fri Dec 16, 2011 3:15 pm Post subject: |
|
|
| Backticks hatte ich probiert - funzt hier nicht, dann gibt es nur Text |
|
| Back to top |
|
jacz Smarty Pro

Joined: 13 Nov 2010 Posts: 249
|
Posted: Fri Dec 16, 2011 3:41 pm Post subject: |
|
|
Das komplette Template ist hier zu sehen:
http://goo.gl/aXsvY |
|
| Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 4177 Location: Hamburg / Germany
|
Posted: Fri Dec 16, 2011 4:30 pm Post subject: |
|
|
Also sowas wie
{dimage_sq image=$t style="`$size[3]` alt=\"Testbildchen\""}
liefert bei mir das richtige Ergebnis. Bist Du Dir sicher das Du die Backtick richtig hattest? |
|
| Back to top |
|
jacz Smarty Pro

Joined: 13 Nov 2010 Posts: 249
|
Posted: Fri Dec 16, 2011 4:45 pm Post subject: |
|
|
Backticks kenne ich natürlich und hatte das auch drin, aber muss beim probieren wohl geschusselt haben oder weil ich das krank vom Bett via Laptop gemacht habe.
Danke - funzt. - bringt auch gleich in der dritten Kommastelle etwas an Zeit. |
|
| 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
|