How can I eval() an HTML template to make a CONSTANT be evaluated
properly?

Previously I have been using regular $variables in my HTML templates.
Today I decided to make one of the $variables a CONSTANT only to find it
would not parse out as it's defined value.  It is instead treated as
regular text.  I tried wrapping the CONSTANT with curly braces, and also
tried using the constant() function with it in the HTML template. 
Neither return the value I previously defined with define().  The manual
says "Constants may be defined and accessed anywhere without regard to
variable scoping rules" but I'm missing something.

I do:

define('TABLE_PARAMETERS', ' border=0 cellspacing=0 cellpadding=0');

Then I get and eval() my template:

$index = getTemplate('index');
eval("\$index = \"$index\";");

And I end up with HTML that looks like:

<table {TABLE_PARAMETERS}>

instead of the desired

<table border=0 cellspacing=0 cellpadding=0> 

Any ideas?  I've google'd, and read lots of docs today trying to figure
it out but I don't know what else to try.

TIA.

-- 
Greg Donald
[EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to