Admun's NUDN

admun

  • San Francisco, CA

Navigation

Navigation

Categories

Search

Template Filling, NucluesCMS way

Here's a snippet of code taken from NP_Blogroll to show how someone can utilize Nucleus's build-in class to do template token replacement.

Say we have a few template var <%var1%>, <%var2%>, <%var3%>.

  // The text with template vars to be processed
  $text = "I have <%var1%> to be <%var2%>, at <%var3%>";

  // Setup value for each template var
  $Vars = array (
    'var1' => "a dog",
    'var2' => " walked",
    'var3' => "home"  
                );

  // processing the text and fill in the template var
  TEMPLATE::fill($text, $Vars);

Handy!

15:59:19 on 03/08/07 by Admun - Developer Notes - tags: - #
<=   March 2007   =>
SunMonTueWedThuFriSat
    123
45678910
11121314151617
18192021222324
25262728293031