Re: heredoc usage [WAS: <OPTION]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At 1:04 AM -0700 10/26/06, Paul Novitski wrote:
At 10/25/2006 11:24 PM, Robert Cummings wrote:
I use a tag based template system, there's no PHP in my content so my
content files for the most part just look like more HTML.

This is a different topic, but also one close to my heart. Yes, I too use my own selector-based templating system. It does allow me to embed PHP variables into the template if I want, but the primary merge between plain HTML template and MySQL content happens through CSS-style selectors.

I also embed php variables inside css -- it gives it more functionality.

----

Hello <jinn:render name="email" selector="firstName"/>,

Cool.

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. :-)

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

Just an idea.

tedd

--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux