Page 1 of 1

Creating a templating system

Posted: Tue Feb 24, 2004 6:15 pm
by Jim
Well, I'm trying to create a templating system (and I don't want to use someone else's) but i'm short of ideas on where to start.

What I've don't thus far is write a class DefineTemplate() which is as such:

Code: Select all

function ParseFile($file_name)
	{

		
		$this->read = str_replace("|screenshot|" , "Pantheon" , $this->read);
		$this->read = str_replace("|filesize|" , "Pantheon" , $this->read);
		$this->read = str_replace("|filename|" , "Pantheon" , $this->read);
		$this->read = str_replace("|screenshot|" , "Pantheon" , $this->read);
		$this->read = str_replace("|screenshot|" , "Pantheon" , $this->read);
				
			
	
	}

Basically, adding a key and a value will create a definition for you. The only problem is, some of these values will be SQL queries (some of them will have to be mysql arrays themselves).

What method do you folks think I should use to create a good templating system?