Req #49380 [Opn->Wfx]: HTML macros
| From: | jani@php.net | Date: | Wed, 29 Dec 2010 12:08:22 +0000 |
| Subject: | Req #49380 [Opn->Wfx]: HTML macros | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-157382@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=49380&edit=1
ID: 49380
Updated by: jani@php.net
Reported by: tcjohans at riseup dot net
Summary: HTML macros
-Status: Open
+Status: Wont fix
Type: Feature/Change Request
-Package: Feature/Change Request
+Package: *General Issues
Operating System: Windows Vista
PHP Version: 5.3.0
Block user comment: N
Private report: N
New Comment:
Please refer to internals list for several discussions on macros.
Previous Comments:
------------------------------------------------------------------------
[2009-08-27 02:08:12] tcjohans at riseup dot net
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 this bug report at http://bugs.php.net/bug.php?id=49380&edit=1