KBD

Keith Devens .com

Saturday, August 30, 2008 Flag waving
That is because you crazy! – Ikea
← Manual RSS generationThe sky is falling! →

Daily link icon Saturday, November 15, 2003

Woo... huge hack!

Man, I don't believe the hack I just had to do to make Smarty to do what I want. I didn't have to modify any of Smarty's code, but it involved a Smarty prefilter that parses a given template for all variable references, then writes out PHP code to execute in the template that calls my CMS to dynamically generate and assign template variables to Smarty corresponding to those variables.

But, this enables the right MVC separation I elaborated earlier. The prefilter overhead is only involved on the initial template parse, and there's really not much overhead for much else. Plus, all this kludgy code I had to write only took a few dozen lines. So all in all it's not too bad.

← Manual RSS generationThe sky is falling! →

Comments XML gif


Feel free to post a comment below. Please see my comment policy.

Formatting Rules (No HTML):

  • **bold**, *italic*, _underlined_, --strikeout--
  • "text"="url" creates a link, and URLs are auto-highlighted
  • Blockquote: Like e-mail, begin paragraph with > (greater-than sign)
  • Lists: begin paragraph with *,-, or + (unordered), or # (ordered)
  • Code block: ?!code:language=perl|php|sql|javascript|etc.{\n}...{\n}?!/code

:
(will be your IP address if blank)
: (optional)
(Will not be shown on site)

: (optional)
:

August 2008
SunMonTueWedThuFriSat
 12
3456789
10111213141516
17181920212223
24252627282930
31 



RSS feed RSS feed for Keith's Weblog
Atom feed Atom feed for Keith's Weblog
Weblog archive
Recent comments
  on 2 posts

Recent comments XML

new⇒Johnny Walker Blue Label

Wow, thanks for the scotch review​:D

Lagavulin and Laphroaig are​some of...

Keith: Aug 29, 3:35pm

Girls, please don't get breast implants

Wow, After all this time, the​comments on this page continue to​grow. It wa...

Ajeet: Aug 25, 2:36am

Generated in about 0.194s.

(Used 8 db queries)

mobile phone