PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > php.smarty.general > assign
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
assign

Réponse
 
LinkBack Outils de la discussion
Vieux 19/04/2006, 16h30   #1
Urb LeJeune
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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

  Réponse avec citation
Vieux 19/04/2006, 21h02   #2
Benjamin Bolbach
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut AW: [SMARTY] assign

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

  Réponse avec citation
Vieux 19/04/2006, 21h27   #3
Ade Olonoh
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [SMARTY] assign

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
  Réponse avec citation
Vieux 20/04/2006, 14h07   #4
Urb LeJeune
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [SMARTY] assign

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
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 19h42.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,10290 seconds with 12 queries