[UPHPU] Template engines
Jacob Wright
jacwright at gmail.com
Tue Oct 10 10:58:11 MDT 2006
My 2¢.
Tempalte systems work out the best for applications that are reused. They
come in handy for adding functionality to systems as well. So any project
that either will be reskined or added onto could benefit from a template
system.
In my experience, I'm usually the one (as a programmer) who has to take a
designers work and integrate it into what I've written or someone else has
written. Template systems make it so there is less I have to do. And for
designers who are willing, they make it nice for them to reskin an app (like
wordpress, etc.).
Smarty works great for me. Granted you will of course run into
> designers who won't use anything that doesn't have a wysiwyg, in which
> case you or someone like you will be doing the coding for them,
I have a template system that you can use in a WYSIWYG. It basically uses
attributes of the tags to place dynamic content. I've found it to work out
very nicely when needing to reskin something because you can see what is
supposed to be in the page.
Example:
<ul>
<li _foreach="$menuItems as $item">
<a _link="$item->link" _echo="ucwords($item->title)" href="dummy.html">Menu
Item 1</a>
</li>
<li _remove=""><a href="#">Menu Item 2 (dummy content)</a>
<li _remove=""><a href="#">Menu Item 3</a>
</ul>
This allows full usage if WYSIWYG and doesn't take too much to learn since
it just uses PHP function names as the attribute names. And there's not
much difference between a comp page and the dynamic page. Even the dummy
content stays in there. Just a few extra attributes (which are removed by
PHP when displayed by the way).
I'll put it up on my site sometime and let the group know. I probably ought
to get it documented before I do that. :)
Jacob Wright
Within Code LLC
(by the way, I'm a contractor now :) but have a contract for the next 6
months, so not available to do anything extra right now, just thought I'd
publicly announce it for those who'd be interested to know. my new company
is Within Code LLC with nothing to it as of yet, haha)
More information about the UPHPU
mailing list