Saffa Kakhuis, my alter ego, decided to start playlisting songs from SaffaTunes in the form of a podcast, to boost...>>read more.
SaffaTunes.com is my own hobby site, I have always been a huge fan of South African music, after having moved to London I was finding it difficult to stay up to date...>>read more.

I have been a little side tracked these passed two weeks, but for good reason, I have got my new and improved website up, no I am not moving.....
read more.
Last week I had a seriously scary experience in that I had at least one unwanted person in my apartment while we were asleep, opened the front.....
read more.
These tutorials reflect personal projects while practicing of new tools, ideas, techniques and technologies. They can not be used on their own as a final solution for any website.
I will be using xHTML, CSS and PHP in most of the tutorials so a basic understanding of each will be ideal but not a requirement if you work each tutorial from the beginning. I will also be making use of the jQuery javascript API for effects, AJAX and loads more.
My personal favourite has got to be the versatile and highly scalable php Smarty Template Engine, so almost everything I build uses it. I'm not on my own in working with and trusting the smarty template engine, there are loads of large names out there using it, Jamroom, XOOPS CMS, Movable Type, WHMCS, Serendipity, CMS Drupal to name a few, go to Smarty's Resources page for more.
The key thing about a scalable website is to use object orientated programming(OOP), this just means, using the same object over and over, but not needing to recode it all each time. So when you start having objects using other objects, you now have a program, simply put as OOP.
With php, an object is a class, the same thing.
Continueing on my previous tutorial. This time around I would like to create my own class, I'll call it SmartStart, to not only innitiate the smarty template engine, but also lay the foundation for our final OOP website, weblog or CMS, whatever you're building.One Ring to rule them all, One Ring to find them,One Ring to bring them all and in the darkness bind them.
- J R R Tolkien, The Fellowship of the Ring
<?php
//include our Smarty class file
require 'includes/Smarty/Smarty.class.php';
require 'lib/SmartStart.class.php';
//create a new SmartStart object and tell it what template to fetch
$smarty = new SmartStart('index');
//assign a value to a variable for use in our template
//$smarty->assign('var','value');
$smarty->assign('title','Web Master Tutorials');
$smarty->assign('content','This is the the content that will be assigned to the $content variable in the .tpl file called with $smarty->display()');
//Now we tell the object to display the page
$smarty->display();
?><?php
class SmartStart {
//assign var names to use throughout the class
var $smarty;
var $template;
//Call our constructor function
function __construct($template) {
//Create our Smarty Template Engine object
$this->smarty = new Smarty();
//Assign the template variables value and I've dropped the .tpl in the innitial call
$this->template = $template.'.tpl';
}
//Our two basic functions that we will use, assigning values and displaying the page
function assign($name, $value){
$this->smarty->assign($name,$value);
}
function display(){
$this->smarty->display($this->template);
}
}
?>
