At 10/26/2006 08:24 AM, tedd wrote:
At 1:04 AM -0700 10/26/06, Paul Novitski wrote:
My comparable example (but in an HTML context) would look like:
Hello <span class="firstName">FIRSTNAME</span>,
where the engine replaces the content of the span with the value
from the database based on a match of 'span.firstName' or perhaps
just '.firstName'. (In this example the 'FIRSTNAME' content in the
template is merely a place-holder to make it easier to preview the
markup and isn't necessary to the merge process.)
I think a <div> would work just as well -- <span> seems so
old-world to me. :-)
By default, div is a block element and span is inline, so span seemed
like the natural fit for a sentence fragment. I don't think there's
anything old-world (!) about spans, Tedd, they're just tags. I use
both in my markup with a clear conscience.
However, if you used preg_match_all, I think you could do away with
the spans all together by matching FIRSTNAME to your first name
variable. That way your document would simply read:
Hello FIRSTNAME
That's true, and in tighly-defined micro-contexts that might work
just fine. For a robust general CMS, though, I want a completely
unambiguous demarcation of replacable content. All-caps tags will
work in some circumstances but certainly won't in others.
Regards,
Paul
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php