List Info

Thread: assign




assign
user name
2006-04-19 14:30:20
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  statement?

         Thanks

Urb
AW: assign
user name
2006-04-19 19:02:43
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:urbusats.com] 
Gesendet: Mittwoch, 19. April 2006 16:30
An: smarty-generallists.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  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
 

-- 
Smarty General Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php

assign
user name
2006-04-19 19:27:36
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  statement?
>
>         Thanks
>
> Urb
>
-- 

Ade Olonoh, Owner/Software Developer
Recursive Function, LLC - Web-based software development
http://recursivefunction
.com | http://www.formspring.com

-- 
Smarty General Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php

assign
user name
2006-04-20 12:07:43
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 

-- 
Smarty General Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php

[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )