PHP Classes

UI Template

Recommend this page to a friend!

      UI Template  >  All threads  >  UI Template  >  (Un) Subscribe thread alerts  
Subject:UI Template
Summary:making temple work????
Messages:2
Author:Dave Kelly
Date:2009-10-11 19:10:16
Update:2009-10-21 13:18:03
 

  1. UI Template   Reply   Report abuse  
Picture of Dave Kelly Dave Kelly - 2009-10-11 19:10:16
I am very very new to PHP. As such I ask question.

This app is something I have been looking for a long time. Thanks.

A simple command 'php index.php ' changes 357 lines into 150 lines of HTML.

What options do I need to include?

TIA
Dave

  2. Re: UI Template   Reply   Report abuse  
Picture of deirathe deirathe - 2009-10-21 13:18:03 - In reply to message 1 from Dave Kelly
You just need to copy all stuff from frea direcotry, put into desired directory, and create autoload function:
function __autoload($cn)
{
$file = "yourdirectory".DIRECTORY_SEPARATOR.str_replace("_",DIRECTORY_SEPARATOR,$cn).".php";
if(is_readable($file))
require_once($file);

}
then just create a template file in desired directory, and create new Template object:
$tpl = new Template();
$tpl->somevar = "some value";//here we are passign variable to template file
$tpl->applyTemplates("my.tpl");//here we parse templatefile

And that's all. Templates are still in development so in near future I will add autoload register function and much more;)

Best regards