NYCPHP Meetup

NYPHP.org

[nycphp-talk] Smarty Templates

billy reisinger billy.reisinger at gmail.com
Wed Nov 2 16:13:26 EST 2005


On 11/2/05, David Mintz <dmintz at davidmintz.org> wrote:
>
> On Wed, 2 Nov 2005, billy reisinger wrote:
>
> > Here's what the php for this block would look
> > like:
> >
> > if ($form.lastname.error) {
> > $template->setCurrentBlock("FORM_ERROR");
> > $template->setVariable("FORM_ERROR_MESSAGE", $form.lastname.error);
> > $template->parseCurrentBlock();
> > }
> > $template->setVariable("FORM_LASTNAME_HTML", $form.lastname.html);
>
> With those dots? What PHP version is that (-:


Uhh, yeah, umm... I'm not sure. The new one. Yeah. That's what I get for
working on eight things at once ;-) Anyway, the idea is that you can reuse a
particular block of HTML for the same purpose, i.e. if you have multiple
error messages, you just slap em in an array, and parse a new error block in
a foreach loop. Saves lots of time!
CHeers,
Billy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20051102/bbd92859/attachment.html>


More information about the talk mailing list