Smarty Templates

Recently, I have been learning about, and working with smarty templates. These are effectively a php based templating system similar to xtemplates accept that they can have logic blocks in them. An example of the call in your index.html file would be as follows:

    $smarty=new smarty;
    $smarty->assign('array', $stuff)

Then in our index.tpl document using smarty, we could make a call as follows:

    {foreach from=$array item=option}
        {if $option.stuff=1}

For more information about the specifics, and some good examples of smarty in action, go here.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: