|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Within a template is it possible to assign more than one variables
within a {assign var="foo" value="Smarty"} statement? Also is it possible to initialize an array within an {assign} statement? Thanks Urb |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
I'm not sure if that is possible,
but anyway it would brake the idea of just dividing code and design, even if there are some ifs, foreachs etc. and even that is too much code inside the tpl in sb's eyes. htha Ben -----Ursprüngliche Nachricht----- Von: Urb LeJeune [mailto:urb@usats.com] Gesendet: Mittwoch, 19. April 2006 16:30 An: smarty-general@lists.php.net Betreff: [SMARTY] assign Within a template is it possible to assign more than one variables within a {assign var="foo" value="Smarty"} statement? Also is it possible to initialize an array within an {assign} statement? Thanks Urb -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.385 / Virus Database: 268.4.4/319 - Release Date: 19.04.2006 -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.385 / Virus Database: 268.4.4/319 - Release Date: 19.04.2006 |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
I don't think you can assign more than one variable.
There might be something better, but I've been able to initialize an array with this hack: {assign var="foo" value=","|explode:"1,2,3,4,5"} This will create an array named "foo" with values 1-5. Urb LeJeune wrote: > Within a template is it possible to assign more than one variables > within a {assign var="foo" value="Smarty"} statement? > > Also is it possible to initialize an array within > an {assign} statement? > > Thanks > > Urb > -- Ade Olonoh, Owner/Software Developer Recursive Function, LLC - Web-based software development http://recursivefunction.com | http://www.formspring.com |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
GM Ade,
Thank you very much for your reply to my question about Smarty assign. >There might be something better, but I've been able to initialize an >array with this hack: > > {assign var="foo" value=","|explode:"1,2,3,4,5"} This is a very clever work around and I love cleverness. I used to teach computer science and I think what you have done is not a hack but rather a "Kluge" :-) A kluge is solving a problem by using something in a way that it was not originally intended to do. Urb |
|
![]() |
| Outils de la discussion | |
|
|