Admun's NUDN

admun

  • San Francisco, CA

Navigation

Navigation

Categories

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 - Category: Developer Notes - tags: - print

Comments

No comments yet

Add Comments



<=   November 2009   =>
SunMonTueWedThuFriSat
1234567
891011121314
15161718192021
22232425262728
2930     

My Quick Links

Documentation

How-To & Tips

Source Code

Developers utc

Latest Comments

  • Admun says If you are running wp from a hosting environment, your system admin people can tell...
  • Dan says Hi, Im a noob and Im not sure what to input for the Database Name, for Nucleus and...
  • Admun says what version of PHP you are running? It looks like this function is...
  • Kevin says I am getting this error: Fatal error: Call to undefined function sql_table() in...
  • Admun says thx Frank, I will look into it.
  • ftruscot says admun, a bug/fix suggestion on the forum that you might want to look at:...
  • Admun says Indeed David. 8( A quick fix for now until 0.9 is out: - do a "ALTER TABLE...
  • David Geens says Dear Edmond, Your twitter plugin suffer from the twitocalyps. You should...

Most Downloads