From: tcjohans at riseup dot net
Operating system: Windows Vista
PHP version: 5.3.0
PHP Bug Type: Feature/Change Request
Bug description: HTML macros
Description:
------------
I propose the ability to create "macros" that can be used in the HTML
(outside of the PHP start and end tags, <?php and ?>).
This will facilitate using PHP in systems oriented to web site builders
who lack knowledge of PHP, but need to use certain interactive features.
The below example creates a macro USERNAME which can be inserted into HTML
to reflect the current site user's name.
However, macros could perhaps also be used to create forms, e.g. by
defining a macro "FORM".
Also, if macros could be defined so as to take arguments, they would be
even more powerful.
Reproduce code:
---------------
<?php
global $USERNAME;
$USERNAME = "John";
macro USERNAME {
global $USERNAME;
echo $USERNAME;
}
?>
Hello!<br>
Your name is USERNAME.<br>
Bye!
Expected result:
----------------
Hello!
Your name is John.
Bye!
--
Edit bug report at http://bugs.php.net/?id=49380&edit=1
--
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=49380&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=49380&r=trysnapshot53
Try a snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=49380&r=trysnapshot60
Fixed in SVN:
http://bugs.php.net/fix.php?id=49380&r=fixed
Fixed in SVN and need be documented:
http://bugs.php.net/fix.php?id=49380&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=49380&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=49380&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=49380&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=49380&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=49380&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=49380&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=49380&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=49380&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=49380&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=49380&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=49380&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=49380&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=49380&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=49380&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=49380&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=49380&r=mysqlcfg