Re: [SMARTY] <? tag problem : Smarty bug?
| From: | Jan Rosier | Date: | Tue, 28 Jan 2003 17:55:43 +0000 |
| Subject: | Re: [SMARTY] <? tag problem : Smarty bug? | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-7368@lists.php.net to get a copy of this message | ||
Hello,
This isn't an Smarty problem. It's actually expected behaviar. PHP default
settings allows you to use an short open tag <? instead of <?php. If you put
the following line in an .htaccess file in your webroot PHP will only use
<?php as an open tag.
php_flag short_open_tag off
Hope this helps
Jan Rosier.
----- Original Message -----
From: <philippe.morange@ca-indosuez.com>
To: <smarty-general@lists.php.net>
Sent: Tuesday, January 28, 2003 11:56 AM
Subject: [SMARTY] <? tag problem : Smarty bug?
> 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.
> ==========================================================
>
>
>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>