<? tag problem : Smarty bug?
| From: | philippe dot morange at ca-indosuez dot com | Date: | Tue, 28 Jan 2003 10:56:04 +0000 |
| Subject: | <? tag problem : Smarty bug? | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-7358@lists.php.net to get a copy of this message | ||
Hi,
I think I may have discovered a bug, but maybe it's just that I'm doing things the wrong
way.
1. When I have in my template: <?xml version="1.0" encoding="ISO-8859-1"?>
it works.
2. But when I have: <?xml version="1.0" encoding="{$myVar}"?> I get a
parse error.
I checked in the compiled code, and it appears that when I don't have any Smarty variable
between my xml tags, it will simply echo the line:
1. <?php echo '<?xml version="1.0" encoding="ISO-8859-1"?>';
?>
If I have ANY Smarty variable on the line, I'll get:
2. <?xml version="1.0" encoding="<?php echo
$this->_tpl_vars['myVar']; ?>"?>
PHP will see the <?xml as a PHP tag, thus giving me a parse error...
I had to write this in my template to make it work:
{literal}<?xml{/literal} version="1.0" encoding="{$myVar}"?>
giving me:
<?php echo '<?xml'; ?> version="1.0" encoding="<?php echo
$this->_tpl_vars['myVar']; ?>"?>
What do you think?
Bug?
==========================================================
Ce message et ses pièces jointes (le "message") est destiné à l'usage exclusif de
son destinataire.
Si vous recevez ce message par erreur, merci d'en aviser immédiatement l'expéditeur et
de le
détruire ensuite. Le présent message pouvant être altéré à notre insu, Crédit Agricole
Indosuez
ne peut pas être engagé par son contenu. Tous droits réservés.
This message and/or any attachments (the "message") is intended for the sole use of its
adressee.
If you are not the adressee, please immediately notify the sender and then destroy the message. As
this message and/or any attachments may have been altered without our knowledge, its content is
not legally binding on Crédit Agricole Indosuez. All rights reserved.
==========================================================