Bug in Smarty Compiler concerning constants?
Oliver Jones <[email protected]>
| Newsgroups | gmane.comp.php.smarty.devel |
|---|---|
| Organization | Deeper Design Limited |
| Message-ID | <[email protected]> |
Hi Folks. I think I might have found a bug in the smarty compiler. In
a template file I wrote, this code:
{if $_admin_user->hasRight(UNIT_MANAGEMENT) }
produces this PHP:
<?php if ($this->_tpl_vars['_admin_user']->hasRight
('UNIT_MANAGEMENT')): ?>
However this template code:
{if $_admin_user->hasRight( UNIT_MANAGEMENT ) }
produces:
<?php if ($this->_tpl_vars['_admin_user']->hasRight
( UNIT_MANAGEMENT )): ?>
The latter being correct. UNIT_MANAGEMENT is a constant defined in a
PHP file earlier "required" into the code base.
Perhaps the Smarty parser needs a little update.
This behaviour was observed in Smarty 2.6.7.
For the moment I will just add spaces around my constants when passing
them to functions in templates.
Regards
--
Oliver Jones » Roving Code Warrior
[email protected] » +64 (21) 41 2238 » www.deeperdesign.com
--
Smarty Development Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php