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 > Associative Arrays with special characters
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Associative Arrays with special characters

Réponse
 
LinkBack Outils de la discussion
Vieux 13/12/2005, 20h39   #1 (permalink)
Andrew Nagy
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Associative Arrays with special characters

I have a serialized XML document in an associative array using
XML_Serializer. Due to the use of namespaces, many of the elements in
the document use a colon ( within the name. Since the names are
stored as the array key, this causes problems with smarty.

How do I reference a variable such as this within smarty:
$array['xlink:href'] ?

When I attempt to use the correct syntax {$array.xlink:href} I get the
following error:
syntax error: unrecognized tag

Any ideas?

Thanks
Andrew
  Réponse avec citation
Vieux 13/12/2005, 20h47   #2 (permalink)
Monte Ohrt
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [SMARTY] Associative Arrays with special characters

http://www.phpinsider.com/smarty-for...pic.php?t=6227

same goes for colons.

Andrew Nagy wrote:

> I have a serialized XML document in an associative array using
> XML_Serializer. Due to the use of namespaces, many of the elements in
> the document use a colon ( within the name. Since the names are
> stored as the array key, this causes problems with smarty.
>
> How do I reference a variable such as this within smarty:
> $array['xlink:href'] ?
>
> When I attempt to use the correct syntax {$array.xlink:href} I get the
> following error:
> syntax error: unrecognized tag
>
> Any ideas?
>
> Thanks
> Andrew
>

  Réponse avec citation
Vieux 14/12/2005, 11h48   #3 (permalink)
Pedro
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [SMARTY] Associative Arrays with special characters

Maybe the documentation should be changed to indicate these facts ??

pete


Monte Ohrt wrote:
> http://www.phpinsider.com/smarty-for...pic.php?t=6227
>
> same goes for colons.
>
> Andrew Nagy wrote:
>
>> I have a serialized XML document in an associative array using
>> XML_Serializer. Due to the use of namespaces, many of the elements in
>> the document use a colon ( within the name. Since the names are
>> stored as the array key, this causes problems with smarty.
>>
>> How do I reference a variable such as this within smarty:
>> $array['xlink:href'] ?
>>
>> When I attempt to use the correct syntax {$array.xlink:href} I get the
>> following error:
>> syntax error: unrecognized tag
>>
>> Any ideas?
>>
>> Thanks
>> Andrew
>>

  Réponse avec citation
Vieux 14/12/2005, 16h51   #4 (permalink)
boots
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [SMARTY] Associative Arrays with special characters

--- Pedro <daffodil@daffodil.uk.com> wrote:
> Maybe the documentation should be changed to indicate these facts ??


Why? Recognized variable syntax is already described succinctly:
http://smarty.php.net/manual/en/lang....variables.php

I see no need to start listing all the things that aren't legal in addition to
saying what *is* legal. The real problem is that no matter what we put in the
manual, people still won't read it.

boots

> pete
>
>
> Monte Ohrt wrote:
> > http://www.phpinsider.com/smarty-for...pic.php?t=6227
> >
> > same goes for colons.
> >
> > Andrew Nagy wrote:
> >
> >> I have a serialized XML document in an associative array using
> >> XML_Serializer. Due to the use of namespaces, many of the elements in
> >> the document use a colon ( within the name. Since the names are
> >> stored as the array key, this causes problems with smarty.
> >>
> >> How do I reference a variable such as this within smarty:
> >> $array['xlink:href'] ?
> >>
> >> When I attempt to use the correct syntax {$array.xlink:href} I get the
> >> following error:
> >> syntax error: unrecognized tag
> >>
> >> Any ideas?
> >>
> >> Thanks
> >> Andrew
> >>



__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
  Réponse avec citation
Vieux 23/12/2005, 16h58   #5 (permalink)
Robert
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [SMARTY] Associative Arrays with special characters

"boots" <jayboots@yahoo.com> wrote in message
news:20051214165109.42825.qmail@web50811.mail.yaho o.com...
> --- Pedro <daffodil@daffodil.uk.com> wrote:
> > Maybe the documentation should be changed to indicate these facts ??

>
> Why? Recognized variable syntax is already described succinctly:
> http://smarty.php.net/manual/en/lang....variables.php
>
> I see no need to start listing all the things that aren't legal in

addition to
> saying what *is* legal. The real problem is that no matter what we put in

the
> manual, people still won't read it.
>


I read it all the time. : )

Robert
  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 03h44.


Édité par : vBulletin® version 3.7.2
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
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,10083 seconds with 13 queries