Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.
Dedicated server web hosting provided by Guru-host.eu.
Kleines Zuweisungsproblem

 
Post new topic   Reply to topic    Smarty Forum Index -> Language: German
View previous topic :: View next topic  
Author Message
jacz
Smarty Pro


Joined: 13 Nov 2010
Posts: 249

PostPosted: Thu Dec 15, 2011 3:05 pm    Post subject: Kleines Zuweisungsproblem Reply with quote

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
View user's profile Send private message Visit poster's website
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 4177
Location: Hamburg / Germany

PostPosted: Fri Dec 16, 2011 2:30 pm    Post subject: Reply with quote

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
View user's profile Send private message
jacz
Smarty Pro


Joined: 13 Nov 2010
Posts: 249

PostPosted: Fri Dec 16, 2011 3:15 pm    Post subject: Reply with quote

Backticks hatte ich probiert - funzt hier nicht, dann gibt es nur Text
Back to top
View user's profile Send private message Visit poster's website
jacz
Smarty Pro


Joined: 13 Nov 2010
Posts: 249

PostPosted: Fri Dec 16, 2011 3:41 pm    Post subject: Reply with quote

Das komplette Template ist hier zu sehen:

http://goo.gl/aXsvY
Back to top
View user's profile Send private message Visit poster's website
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 4177
Location: Hamburg / Germany

PostPosted: Fri Dec 16, 2011 4:30 pm    Post subject: Reply with quote

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
View user's profile Send private message
jacz
Smarty Pro


Joined: 13 Nov 2010
Posts: 249

PostPosted: Fri Dec 16, 2011 4:45 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Language: German 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