Page 1 of 1

rate my code

Posted: Fri Jul 08, 2005 6:39 am
by kylephp
Hello,

Could you guys please tell me what you think of my code if its proper or if it will corse problems.

Thanks.

Code: Select all

//************************************************//
//*          					**//
//* includes					**//
//*          					**//
//************************************************//

//* include('system/classes.php'); *//

class html 
{ 
	var $template; 
    var $parameters = array(); 
    
	function html($location) 
	{ 
		$this->template = $location; 
	}
	 
    function setParameter($param, $value) 
	{ 
		$this->parameters["$param"] = $value; 
	}
	
    function createHTML() 
	{ 
        $html = implode("", (file($this->template))); 
        
		foreach($this->parameters as $key => $value) 
		{ 
            $html = str_replace("{".$key."}", $value, $html); 
        } 
        
		return $html; 
    } 
} 

//* include('system/classes.php'); ( end file ) *//

//************************************************//
//*          				        **//
//* modules  					**//
//*          					**//
//************************************************//

//* include('modules/main.php'); *//

function mainModule()
{
    $html_page = array ();

    $html_page['title'] = 'demo';
    $html_page['content'] = 'demo content';
}

//* include('modules/main.php'); ( end page )*//

//************************************************//
//*          					**//
//* echo output					**//
//*          					**//
//************************************************//

$html_page = mainModule();

$html = new html("templates/html.tpl");
$html->setParameter("html_page_title", $html_page['title']);
$html->setParameter("html_page_content", $html_page['content']);

echo $html->createHTML(); 

//************************************************//
thats my page.
{
var $template;
var $parameters = array();

function html($location)
{
$this->template = $location;
}

function setParameter($param, $value)
{
$this->parametersї&quote;$param&quote;] = $value;
}

function createHTML()
{
$html = implode(&quote;&quote;, (file($this->template)));

foreach($this->parameters as $key => $value)
{
$html = str_replace(&quote;{&quote;.$key.&quote;}&quote;, $value, $html);
}

return $html;
}
}

//* include('system/classes.php'); ( end file ) *//

//************************************************//
//* **//
//* modules **//
//* **//
//************************************************//

//* include('modules/main.php'); *//

function mainModule()
{
$html_page = array ();

$html_pageї'title'] = 'demo';
$html_pageї'content'] = 'demo content';
}

//* include('modules/main.php'); ( end page )*//

//************************************************//
//* **//
//* echo output **//
//* **//
//************************************************//

$html_page = mainModule();

$html = new html(&quote;templates/html.tpl&quote;);
$html->setParameter(&quote;html_page_title&quote;, $html_pageї'title']);
$html->setParameter(&quote;html_page_content&quote;, $html_pageї'content']);

echo $html->createHTML();

//************************************************//



thats my page.ule()
{
$html_page = array ();

$html_page['title'] = 'demo';
$html_page['content'] = 'demo content';
}

//* include('modules/main.php'); ( end page )*//

//************************************************//
//* **//
//* echo output **//
//* **//
//************************************************//

$html_page = mainModule();

$html = new html(&quote;templates/html.tpl&quote;);
$html->setParameter(&quote;html_page_title&quote;, $html_pageї'title']);
$html->setParameter(&quote;html_page_content&quote;, $html_pageї'content']);

echo $html->createHTML();

//************************************************//



thats my page.*****************************//
//* **//
//* includes **//
//* **//
//************************************************//

//* include('system/classes.php'); *//

class html
{
var $template;
var $parameters = array();

function html($location)
{
$this->template = $location;
}

function setParameter($param, $value)
{
$this->parametersї&quote;$param&quote;] = $value;
}

function createHTML()
{
$html = implode(&quote;&quote;, (file($this->template)));

foreach($this->parameters as $key => $value)
{
$html = str_replace(&quote;{&quote;.$key.&quote;}&quote;, $value, $html);
}

return $html;
}
}

//* include('system/classes.php'); ( end file ) *//

//************************************************//
//* **//
//* modules **//
//* **//
//************************************************//

//* include('modules/main.php'); *//

function mainModule()
{
$html_page = array ();

$html_pageї'title'] = 'demo';
$html_pageї'content'] = 'demo content';
}

//* include('modules/main.php'); ( end page )*//

//************************************************//
//* **//
//* echo output **//
//* **//
//************************************************//

$html_page = mainModule();

$html = new html(&quote;templates/html.tpl&quote;);
$html->setParameter(&quote;html_page_title&quote;, $html_pageї'title']);
$html->setParameter(&quote;html_page_content&quote;, $html_pageї'content']);

echo $html->createHTML();

//************************************************//

[/ph/classes.php'); *//

class html
{
var $template;
var $parameters = array();

function html($location)
{
$this->template = $location;
}

function setParameter($param, $value)
{
$this->parameters["$param"] = $value;
}

function createHTML()
{
$html = implode("", (file($this->template)));

foreach($this->parameters as $key => $value)
{
$html = str_replace(&quote;{&quote;.$key.&quote;}&quote;, $value, $html);
}

return $html;
}
}

//* include('system/classes.php'); ( end file ) *//

//************************************************//
//* **//
//* modules **//
//* **//
//************************************************//

//* include('modules/main.php'); *//

function mainModule()
{
$html_page = array ();

$html_pageї'title'] = 'demo';
$html_pageї'content'] = 'demo content';
}

//* include('modules/main.php'); ( end page )*//

//************************************************//
//* **//
//* echo output **//
//* **//
//************************************************//

$html_page = mainModule();

$html = new html(&quote;templates/html.tpl&quotenction html($location)
{
$this->template = $location;
}

function setParameter($param, $value)
{
$this->parameters["$param"] = $value;
}

function createHTML()
{
$html = implode("", (file($this->template)));

foreach($this->parameters as $key => $value)
{
$html = str_replace("{&quote;.$key.&quote;}&quote;, $value, $html);
}

return $html;
}
}

//* include('system/classes.php'); ( end file ) *//

//************************************************//
//* **//
//* modules **//
//* **//
//************************************************//

//* include('modules/m it will corse problems.

Thanks.

Code: Select all

//************************************************//
//*          					**//
//* includes					**//
//*          					**//
//************************************************//

//* include('system/classes.php'); *//

class html 
{ 
	var $template; 
    var $parameters = array(); 
    
	function html($location) 
	{ 
		$this->template = $location; 
	}
	 
    function setParameter($param, $value) 
	{ 
		$this->parametersї&quote;$param&quote;] = $value; 
	}
	
    function createHTML() 
	{ 
        $html = implode(&quote;&quote;, (file($this->template))); 
        
		foreach($this->parameters as $key => $value) 
		{ 
            $html = str_replace(&quote;{&quote;.$key.&quote;}&quote;, $value, $html); 
        } 
        
		return $html; 
    } 
} 

//* include('system/classes.php'); ( end file ) *//

//************************************************//
//*          				        **//
//* modules  					**//
//*          					**//
//************************************************//

//* include('modules/main.php'); *//

function mainModule()
{
    $html_page = array ();

    $html_pageї'title'] = 'demo';
    $html_pageї'content'] = 'demo content';
}

//* include('modules/main.php'); ( end page )*//

//************************************************//
//*          					**//
//* echo output					**//
//*          					**//
//************************************************//

$html_page = mainModule();

$html = new html(&quote;templates/html.tpl&quote;);
$html->setParameter(u guys please tell me what you think of my code if its proper or if it will corse problems.

Thanks.

Code: Select all

//************************************************//
//*          					**//
//* includes					**//
//*          					**//
//************************************************//

//* include('system/classes.php'); *//

class html 
{ 
	var $template; 
    var $parameters = array(); 
    
	function html($location) 
	{ 
		$this->template = $location; 
	}
	 
    function setParameter($param, $value) 
	{ 
		$this->parameters["$param"] = $value; 
	}
	
    function createHTML() 
	{ 
        $html = implode("", (file($this->template))); 
        
		foreach($this->parameters as $key => $value) 
		{ 
            $html = str_replace("{".$key."}", $value, $html); 
        } 
        
		return $html; 
    } 
} 

//* include('system/classes.php'); ( end file ) *//

//************************************************//
//*          				        **//
//* modules  				]

//************************************************//
//*          					**//
//* includes					**//
//*          					**//
//************************************************//

//* include('system/classes.php'); *//

class html 
{ 
	var $template; 
    var $parameters = array(); 
    
	function html($location) 
	{ 
		$this->template = $location; 
	}
	 
    function setParameter($param, $value) 
	{ 
		$this->parametersї&quote;$param&quote;] = $value; 
	}
	
    function createHTML() 
	{ 
        $html = implode(&quote;&quote;, (file($this->template))); 
        
		foreach($this->parameters as $key => $value) 
		{ 
            $html = str_replace(&quote;{&quote;.$key.&quote;}&quote;, $value, $html); 
        } 
        
		return $html; 
    } 
} 

//* include('system/classes.php'); ( end file ) *//

//************************************************//
//*          				        **//
//* modules  					**//
//*          					**//
//************************************************//

//* include('modules/main.php'); *//

function mainModule()
{
    $html_page = array ();

    $html_pageї'title'] = 'demo';
    $html_pageї'content'] = 'demo content';
}

//* include('modules/main.php'); ( end page )*//

//************************************************//
//*          					**//
//* echo output					**//
//*          					**//
//************************************************//

$html_page = mainModule();

$html = new html(&quote;templates/html.tpl&quote;);
$html->setParameter(&quote;html_page_tcludes					**//
//*          					**//
//************************************************//

//* include('system/classes.php'); *//

class html 
{ 
	var $template; 
    var $parameters = array(); 
    
	function html($location) 
	{ 
		$this->template = $location; 
	}
	 
    function setParameter($param, $value) 
	{ 
		$this->parametersї&quote;$param&quote;] = $value; 
	}
	
    function createHTML() 
	{ 
        $html = implode(&quote;&quote;, (file($this->template))); 
        
		foreach($this->parameters as $key => $value) 
		{ 
            $html = str_replace(&quote;{&quote;.$key.&quote;}&quote;, $value, $html); 
        } 
        
		return $html; 
    } 
} 

//* include('system/classes.php'); ( end file ) *//

//************************************************//
//*          				        **//
//* modules  					**//
//*          					**//
//************************************************//

//* include('modules/main.php'); *//

function mainModule()
{
    $html_page = array ();

    $html_pageї'title'] = 'demo';
    $html_pageї'content'] = 'demo content';
}

//* include('modules/main.php'); ( end page )*//

//************************************************//
//*          					**//
//* echo output					**//
//*          					**//
//************************************************//

$html_page = mainModule();

$html = new html(&quote;templates/html.tpl&quote;);
$html->setParameter(&quote;html_page_title&quote;, $html_pageї'title']);
$html-&gt322949e]

//************************************************//
//*          					**//
//* includes					**//
//*          					**//
//************************************************//

//* include('system/classes.php'); *//

class html 
{ 
	var $template; 
    var $parameters = array(); 
    
	function html($location) 
	{ 
		$this->template = $location; 
	}
	 
    function setParameter($param, $value) 
	{ 
		$this->parameters["$param"] = $value; 
	}
	
    function createHTML() 
	{ 
        $html = implode("", (file($this->template))); 
        
		foreach($this->parameters as $key => $value) 
		{ 
            $html = str_replace(&quote;{&quote;.$key.&quote;}&quote;, $value, $html); 
        } 
        
		return $html; 
    } 
} 

//* include('system/classes.php'); ( end file ) *//

//************************************************//
//*          				        **//
//* modules  					**//
//*          					**//
//************************************************//

//* include('modules/main.php'); *//

function mainModule()
{
    $html_page = array ();

    $html_pageї'title'] = 'demo';
    $html_pageї'cont9e]

//************************************************//
//*          					**//
//* includes					**//
//*          					**//
//************************************************//

//* include('system/classes.php'); *//

class html 
{ 
	var $template; 
    var $parameters = array(); 
    
	function html($location) 
	{ 
		$this->template = $location; 
	}
	 
    function setParameter($param, $value) 
	{ 
		$this->parametersї&quote;$param&quote;] = $value; 
	}
	
    function createHTML() 
	{ 
        $html = implode(&quote;&quote;, (file($this->template))); 
        
		foreach($this->parameters as $key => $value) 
		{ 
            $html = str_replace(&quote;{&quote;.$key.&quote;}&quote;, $value, $html); 
        } 
        
		return $html; 
    } 
} 

//* include('system/classes.php'); ( end file ) *//

//************************************************//
//*          				        **//
//* modules  					**//
//*          					**//
//************************************************//

//* include('modules/main.php'); *//

function mainModule()
{
    $html_page = array ();

    $html_pageї'title'] = 'demo';
    $html_pageї'content'] = 'demo content';
}

//* include('modules/main.php'); ( end page )*//

//************************************************//
//*          					**//
//* echo output					**//
//*          					**//
//************************************************//

$html_page = mainModule();

$html = new html(&quote;templates/html.tpl&quote;);
$html->setParameter(&quote;html_page_title&quote;, $html_pageї'title']);
$html->setParameter(&quote;html_page_content&quote;, $html_pageї'cont
    
	function html($location) 
	{ 
		$this->template = $location; 
	}
	 
    function setParameter($param, $value) 
	{ 
		$this->parameters["$param"] = $value; 
	}
	
    function createHTML() 
	{ 
        $html = implode("", (file($this->template))); 
        
		foreach($this->parameters as $key => $value) 
		{ 
            $html = str_replace("{".$key."}", $value, $html); 
        } 
        
		return $html; 
    } 
} 

//* include('system/classes.php'); ( end file ) *//

//************************************************//
//*          				        **//
//* modules  					**//
//*          					**//
//************************************************//

//* include('modules/main.php'); *//

function mainModule()
{
    $html_page = array ();

    $html_page['title'] = 'demo';
    $html_page['content'] = 'demo content';
}

//* include('modules/main.php'); ( end page )*//

//************************************************//
//*          					**//
//* echo output					**//
//*          					**//
//************************************************//

$html_page = mainModule();

$html = new html("templates/html.tpl");
$html->setParameter("html_page_title", $html_page['title']);
$html->setParameter("html_page_content", $html_page['content']);

echo $html->createHTML(); 

//************************************************//
thats my page. $value)
{
$this->parameters["$param"] = $value;
}

function createHTML()
{
$html = implode("", (file($this->template)));

foreach($this->parameters as $key => $value)
{
$html = str_replace("{".$key."}", $value, $html);
}

return $html;
}
}

//* include('system/classes.php'); ( end file ) *//

//************************************************//
//* **//
//* modules **//
//* **//
//************************************************//

//* include('modules/main.php'); *//

function mainModule()
{
$html_page = array ();

$html_page['title'] = 'demo';
$html_page['content'] = 'demo content';
}

//* include('modules/main.php'); ( end page )*//

//************************************************//
//* **//
//* echo output **//
//* **//
//*********************************
Thanks.

Code: Select all

//************************************************//
//*          					**//
//* includes					**//
//*          					**//
//************************************************//

//* include('system/classes.php'); *//

class html 
{ 
	var $template; 
    var $parameters = array(); 
    
	function html($location) 
	{ 
		$this->template = $location; 
	}
	 
    function setParameter($param, $value) 
	{ 
		$this->parametersї&quote;$param&quote;] = $value; 
	}
	
    function createHTML() 
	{ 
        $html = implode("", (file($this->template))); 
        
		foreach($this->parameters as $key => $value) 
		{ 
            $html = str_replace(&quote;{&quote;.$key.&quote;}&quote;, $value, $html); 
        } 
        
		return $html; 
    } 
} 

//* include('system/classes.php'); ( end file ) *//

//************************************************//
//*          				        **//
//* modules  					**//
//*          					**//
//************************************************//

//* include('modules/main.php'); *//

function mainModule()
{
 ode if its proper or if it will corse problems.

Thanks.

Code: Select all

//************************************************//
//*          					**//
//* includes					**//
//*          					**//
//************************************************//

//* include('system/classes.php'); *//

class html 
{ 
	var $template; 
    var $parameters = array(); 
    
	function html($location) 
	{ 
		$this->template = $location; 
	}
	 
    function setParameter($param, $value) 
	{ 
		$this->parameters["$param"] = $value; 
	}
	
    function createHTML() 
	{ 
        $html = implode("", (file($this->template))); 
        
		foreach($this->parameters as $key => $value) 
		{ 
            $html = str_replace("{".$key."}", $value, $html); 
        } 
        
		return $html; 
    } 
} 

//* include('system/classes.php'); ( end file ) *//

//************************************************//
//*          				        **//
//* modules  					**//
//*          					**//
//************************************************//

//* include('modules/main.php'); *//

function mainModule()
******************//
//*          					**//
//* includes					**//
//*          					**//
//************************************************//

//* include('system/classes.php'); *//

class html 
{ 
	var $template; 
    var $parameters = array(); 
    
	function html($location) 
	{ 
		$this->template = $location; 
	}
	 
    function setParameter($param, $value) 
	{ 
		$this->parametersї&quote;$param&quote;] = $value; 
	}
	
    function createHTML() 
	{ 
        $html = implode(&quote;&quote;, (file($this->template))); 
        
		foreach($this->parameters as $key => $value) 
		{ 
            $html = str_replace(&quote;{&quote;.$key.&quote;}&quote;, $value, $html); 
        } 
        
		return $html; 
    } 
} 

//* include('system/classes.php'); ( end file ) *//

//************************************************//
//*          				        **//
//* modules  					**//
//*          					**//
//************************************************//

//* include('modules/main.php'); *//

function mainModule()
{
    $html_page = array ();

    $html_pageї'title'] = 'demo';
    $html_pageї'content'] = 'demo content';
}

//* include('modules/main.php'); ( end page )*//

//************************************************//
//*          					**//
//* echo output					**//
//*          					**//
//************************************************//

$html_page = mainModule();

$html = new html(&quote;templates/html.tpl&quote;);
$html->setParameter(&quote;html_page_title&quote;, $html_pageї'title']);
$html->setParameter(&quote;html_page_content&quote;, $html_pageї'content']);

echo $html->createHTML(); 

//*****************************************************************//

//* include('system/classes.php'); *//

class html 
{ 
	var $template; 
    var $parameters = array(); 
    
	function html($location) 
	{ 
		$this->template = $location; 
	}
	 
    function setParameter($param, $value) 
	{ 
		$this->parameters["$param"] = $value; 
	}
	
    function createHTML() 
	{ 
        $html = implode("", (file($this->template))); 
        
		foreach($this->parameters as $key => $value) 
		{ 
            $html = str_replace(&quote;{&quote;.$key.&quote;}&quote;, $value, $html); 
        } 
        
		return $html; 
    } 
} 

//* include('system/classes.php'); ( end file ) *//

//************************************************//
//*          				        **//
//* modules  					**//
//*          					**//
//************************************************//

//* include('modules/main.php'); *//

function mainModule()
{
    $html_page = array ();

    $html_pageї'title'] = 'demo';
    $html_pageї'content'] = 'demo content';
}

//* include('modules/main.php'); ( end page )*//

//************************************************//
//*          					**//
//* echo output					**//
//*          					**//
//************************************************//

$html_page = mainModule();

$html = new html(&quote;templates/html.tpl&quote;);
$html->setParameter(&quote;html_page_title&quote;, $html_pageї'title']);
$html->setParameter(&quote;html_page_content&quote;, $html_pageї'content']);

echo $html->createHTML(); 

html = implode("", (file($this->template))); 
        
		foreach($this->parameters as $key => $value) 
		{ 
            $html = str_replace(&quote;{&quote;.$key.&quote;}&quote;, $value, $html); 
        } 
        
		return $html; 
    } 
} 

//* include('system/classes.php'); ( end file ) *//

//************************************************//
//*          				        **//
//* modules  					**//
//*          					**//
//************************************************//

//* include('modules/main.php'); *//

function mainModule()
{
    $html_page = array ();

    $html_pageї'title'] = 'demo';
    $html_pageї'content'] = 'demo content';
}

//* include('modules/main.php'); ( end page )*//

//************************************************//
//*          		ystem/classes.php'); *//

class html 
{ 
	var $template; 
    var $parameters = array(); 
    
	function html($location) 
	{ 
		$this->template = $location; 
	}
	 
    function setParameter($param, $value) 
	{ 
		$this->parametersї&quote;$param&quote;] = $value; 
	}
	
    function createHTML() 
	{ 
        $html = implode(&quote;&quote;, (file($this->template))); 
        
		foreach($this->parameters as $key => $value) 
		{ 
            $html = str_replace(&quote;{&quote;.$key.&quote;}&quote;, $value, $html); 
        } 
        
		return $html; 
    } 
} 

//* include('system/classes.php'); ( end file ) *//

//************************************************//
//*          				        **//
//* modules  					**//
//*          					**//
//************************************************//

//* include('modules/main.php'); *//

function mainModule()
{
    $html_page = array ();

    $html_pageї'title'] = 'demo';
    $html_pageї'content'] = 'demo content';
}

//* include('modules/main.php'); ( end page )*//

//************************************************//
//*          					**//
//* echo output					**//
//*          					**//
//******************************** my code if its proper or if it will corse problems.

Thanks.

Code: Select all

//************************************************//
//*          					**//
//* includes					**//
//*          					**//
//************************************************//

//* include('system/classes.php'); *//

class html 
{ 
	var $template; 
    var $parameters = array(); 
    
	function html($location) 
	{ 
		$this->template = $location; 
	}
	 
    function setParameter($param, $value) 
	{ 
		$this->parameters["$param"] = $value; 
	}
	
    function createHTML() 
	{ 
        $html = implode("", (file($this->template))); 
        
		foreach($this->parameters as $key => $value) 
		{ 
            $html = str_replace("{".$key."}", $value, $html); 
        } 
        
		return $html; 
    } 
} 

//* include('system/classes.php'); ( end file ) *//

//************************************************//
//*          				        **//
//* modules  					**//
//*          					**//
//************************************************//

//* include('modules/main.php'); *//

function mainModule()
{
    $html_page = array ();

    $html_page['title'] = 'demo';
    $html_page['content'] = 'demo content';
}

//* include('modules/main.php'); ( end page )*//

//************************************************//
//*          					**//
//* echo output					**//
//*          					**//
//************************************************//

$html_page = mainModule();

$html = new html("templates/html.tpl");
$html->setParameter("html_page_title", $html_page['title']);
$html->setParameter("html_page_content&qu   					**//
//************************************************//

//* include('system/classes.php'); *//

class html 
{ 
	var $template; 
    var $parameters = array(); 
    
	function html($location) 
	{ 
		$this->template = $location; 
	}
	 
    function setParameter($param, $value) 
	{ 
		$this->parameters["$param"] = $value; 
	}
	
    function createHTML() 
	{ 
        $html = implode("", (file($this->template))); 
        
		foreach($this->parameters as $key => $value) 
		{ 
            $html = str_replace("{".$key."}", $value, $html); 
        } 
        
		return $html; 
    } 
} 

//* include('system/classes.php'); ( end file ) *//

//************************************************//
//*          				        **//
//* modules  					**//
//*          					**//
//************************************************//

//* include('modules/main.php'); *//

function mainModule()
{
    $html_page = array ();

    $html_page['title'] = 'demo';
    $html_page['content'] = 'demo content';
}

//* include('modules/main.php'); ( end page )*//

//************************************************//
//*          					**//
//* echo output					**//
//*          					**//
//************************************************//

$html_page = mainModule();

$html = new html("templates/html.tpl");
$html->setParameter("html_page_title", $html_page['title'])des					**//
//*          					**//
//************************************************//

//* include('system/classes.php'); *//

class html 
{ 
	var $template; 
    var $parameters = array(); 
    
	function html($location) 
	{ 
		$this->template = $location; 
	}
	 
    function setParameter($param, $value) 
	{ 
		$this->parameters["$param"] = $value; 
	}
	
    function createHTML() 
	{ 
        $html = implode("", (file($this->template))); 
        
		foreach($this->parameters as $key => $value) 
		{ 
            $html = str_replace("{".$key."}", $value, $html); 
        } 
        
		return $html; 
    } 
} 

//* include('system/classes.php'); ( end file ) *//

//************************************************//
//*          				        **//
//* modules  					**//
//*          					**//
//************************************************//

//* include('modules/main.php'); *//

function mainModule()
{
    $html_page = array ();

    $html_page['title'] = 'demo';
    $html_page['content'] = 'demo content';
}

//* include('modules/main.php'); ( end page )*//

//************************************************//
//*          					**//
//* echo output					**//
//*          					**//
//************************************************//

$html_page = mainModule();

$html = new html("templates/html.tpl");
$html->setParameter("html_page_title", $html_page['title']);
$html->setParameter("html_page_content", $html_page['content']);

echo $html-&amamp;quote;, (file($this->template))); 
        
		foreach($this->parameters as $key => $value) 
		{ 
            $html = str_replace("{".$key."}", $value, $html); 
        } 
        
		return $html; 
    } 
} 

//* include('system/classes.php'); ( end file ) *//

//************************************************//
//*          				        **//
//* modules  					**//
//*          					**//
//************************************************//

//* include('modules/main.php'); *//

function mainModule()
{
    $html_page = array ();

    $html_page['title'] = 'demo';
    $html_page['content'] = 'd;parameters["$param"] = $value; 
	}
	
    function createHTML() 
	{ 
        $html = implode("", (file($this->template))); 
        
		foreach($this->parameters as $key => $value) 
		{ 
            $html = str_replace("{".$key."}", $value, $html); 
        } 
        
		return $html; 
    } 
} 

//* include('system/classes.php'); ( end file ) *//

//************************************************//
//*          				        **//
//* modules  					**//
//*          					**//
//************************************************//

//* include('modules/main.php'); *//

function mainModule()
{
    $html_page = array ();

    $html_page['title'] = 'demo';
    $html_page['content'] = 'demo content';
}

//* include('modules/main.php'); ( end page )*//

//************************************************//
//*          					**//
//* echo output					**//
//*          					**//
//************************************************//

$html_page = mainModule();

$html = new html("templates/html.tpl");
$html->setParameter("html_page_title", $html_page['title']);
$html->setParameter("html_page_content", $html_page['content']);

echo $html->createHTML(); 

//************************************************//
thats my page.******************************//
//* **//
//* includes **//
//* **//
//************************************************//

//* include('system/classes.php'); *//

class html
{
var $template;
var $parameters = array();

function html($location)
{
$this->template = $location;
}

function setParameter($param, $value)
{
$this->parametersї&quote;$param&quote;] = $value;
}

function createHTML()
{
$html = implode(&quote;&quote;, (file($this->template)));

foreach($this->parameters as $key => $value)
{
$html = str_replace(&quote;{&quote;.$key.&quote;}&quote;, $value, $html);
}

return $html;
}
}

//* include('system/classes.php'); ( end file ) *//

//************************************************//
//* **//
//* modules **//
//* **//
//************************************************//

//* include('modules/main.php'); *//

function mainModule()
{
$html_page = array ();

$html_pageї'title'] = 'demo';
$html_pageї'content'] = 'demo content';
}

//* include('modules/main.php'); ( end page )*//

//************************************************//
//* **//
//* echo output **//
//* **//
//************************************************//

$html_page = mainModule();

$html = new html(&quote;templates/html.tpl&quote;);
$html->setParameter(&quote;html_page_title&quote;, $html_pageї'title']);
$html->setParameter(&q me what you think of my code if its proper or if it will corse problems.

Thanks.

Code: Select all

//************************************************//
//*          					**//
//* includes					**//
//*          					**//
//************************************************//

//* include('system/classes.php'); *//

class html 
{ 
	var $template; 
    var $parameters = array(); 
    
	function html($location) 
	{ 
		$this->template = $location; 
	}
	 
    function setParameter($param, $value) 
	{ 
		$this->parameters["$param"] = $value; 
	}
	
    function createHTML() 
	{ 
        $html = implode("", (file($this->template))); 
        
		foreach($this->parameters as $key => $value) 
		{ 
            $html = str_replace("{".$key."}", $value, $html); 
        } 
        
		return $html; 
    } 
} 

//* include('system/classes.php'); ( end file ) *//

//************************************************//
//*          				        **//
//* modules  					**//
//*             					**//
//************************************************//

//* include('system/classes.php'); *//

class html 
{ 
	var $template; 
    var $parameters = array(); 
    
	function html($location) 
	{ 
		$this->template = $location; 
	}
	 
    function setParameter($param, $value) 
	{ 
		$this->parameters["$param"] = $value; 
	}
	
    function createHTML() 
	{ 
        $html = implode("", (file($this->template))); 
        
		foreach($this->parameters as $key => $value) 
		{ 
            $html = str_replace(&quote;{&quote;.$key.&quote;}&quote;, $value, $html); 
        } 
        
		return $html; 
    } 
} 

//* include('system/classes.php'); ( end file ) *//

//************************************************//
//*          				        **//
//* modules  					**//
//*          					**//
//************************************************//

//* include('modules/main.php')code if its proper or if it will corse problems.

Thanks.

Code: Select all

//************************************************//
//*          					**//
//* includes					**//
//*          					**//
//************************************************//

//* include('system/classes.php'); *//

class html 
{ 
	var $template; 
    var $parameters = array(); 
    
	function html($location) 
	{ 
		$this->template = $location; 
	}
	 
    function setParameter($param, $value) 
	{ 
		$this->parameters["$param"] = $value; 
	}
	
    function createHTML() 
	{ 
        $html = implode("", (file($this->template))); 
        
		foreach($this->parameters as $key => $value) 
		{ 
            $html = str_replace("{".$key."}", $value, $html); 
        } 
        
		return $html; 
    } 
} 

//* include('system/classes.php'); ( end file ) *//

//************************************************//
//*          				        **//
//* modules  					* my code if its proper or if it will corse problems.

Thanks.

Code: Select all

//************************************************//
//*          					**//
//* includes					**//
//*          					**//
//************************************************//

//* include('system/classes.php'); *//

class html 
{ 
	var $template; 
    var $parameters = array(); 
    
	function html($location) 
	{ 
		$this->template = $location; 
	}
	 
    function setParameter($param, $value) 
	{ 
		$this->parameters[&quote;$param&quote;] = $value; 
	}
	
    function createHTML() 
	{ 
        $html = implode(&quote;&quote;, (file($this->template))); 
        
		foreach($this->parameters as $key => $value) 
		{ 
            $html = str_replace(&quote;{&quote;.$key.&quote;}&quote;, $value, $html); 
        } 
        
		return $html; 
    } 
} 

//* include('system/classes.php'); ( end file ) *//

//************************************************//
//*          				        **//
//* modules  					**//
//*          					**//
//************************************************//

//* include('modules/main.php'); *//

function mainModule()
{
    $html_page = array ();

    $html_pageї'title'] = 'demo';
    $html_pageї'content'] = 'demo content';
}

//* include('modules/main.php'); ( end page )*//

//******************************ll me what you think of my code if its proper or if it will corse problems.

Thanks.

Code: Select all

//************************************************//
//*          					**//
//* includes					**//
//*          					**//
//************************************************//

//* include('system/classes.php'); *//

class html 
{ 
	var $template; 
    var $parameters = array(); 
    
	function html($location) 
	{ 
		$this->template = $location; 
	}
	 
    function setParameter($param, $value) 
	{ 
		$this->parameters["$param"] = $value; 
	}
	
    function createHTML() 
	{ 
        $html = implode("", (file($this->template))); 
        
		foreach($this->parameters as $key => $value) 
		{ 
            $html = str_replace("{".$key."}", $value, $html); 
        } 
        
		return $html; 
    } 
} 

//* include('system/classes.php'); ( end file ) *//

//************************************************//
//*          				        **//
//* modules  					**//
//*          					**//
//************************************************//

//* include('modules/main.php'); *//

function mainModule()
{
    $html_page = array ();

    $html_page['title'] = 'demo';
    $html_page['content'] = 'demo content';
}

//* include('modules/main.php'); ( end page )*//

//************************************************//
//*          					**//
//* echo output					**//
//*          					**//
//************************************************//

$html_page = mainModule();

$html = new html("templates/html.tpl");
$html->setParameter("html_page_title", $html_page['title']);
$html->setParameter("html_p***********************************************//
//*          					**//
//* includes					**//
//*          					**//
//************************************************//

//* include('system/classes.php'); *//

class html 
{ 
	var $template; 
    var $parameters = array(); 
    
	function html($location) 
	{ 
		$this->template = $location; 
	}
	 
    function setParameter($param, $value) 
	{ 
		$this->parametersї&quote;$param&quote;] = $value; 
	}
	
    function createHTML() 
	{ 
        $html = implode(&quote;&quote;, (file($this->template))); 
        
		foreach($this->parameters as $key => $value) 
		{ 
            $html = str_replace(&quote;{&quote;.$key.&quote;}&quote;, $value, $html); 
        } 
        
		return $html; 
    } 
} 

//* include('system/classes.php'); ( end file ) *//

//************************************************//
//*          				        **//
//* modules  					**//
//*          					**//
//************************************************//

//* include('modules/main.php'); *//

function mainModule()
{
    $html_page = array ();

    $html_pageї'title'] = 'demo';
    $html_pageї'content'] = 'demo content';
}

//* include('modules/main.php'); ( end page )*//

//************************************************//
//*          					**//
//* echo output					**//
//*          					**//
//************************************************//

$html_page = mainModule();

$html = new html(&quote;templates/html.tpl&quote;);
$html->setParameter(&amp please tell me what you think of my code if its proper or if it will corse problems.

Thanks.

Code: Select all

//************************************************//
//*          					**//
//* includes					**//
//*          					**//
//************************************************//

//* include('system/classes.php'); *//

class html 
{ 
	var $template; 
    var $parameters = array(); 
    
	function html($location) 
	{ 
		$this->template = $location; 
	}
	 
    function setParameter($param, $value) 
	{ 
		$this->parametersї&quote;$param&quote;] = $value; 
	}
	
    function createHTML() 
	{ 
        $html = implode(&quote;&quote;, (file($this->template))); 
        
		foreach($this->parameters as $key => $value) 
		{ 
            $html = str_replace(&quote;{&quote;.$key.&quote;}&quote;, $value, $html); 
        } 
        
		return $html; 
    } 
} 

//* include('system/classes.php'); ( end file ) *//

//************************************************//
//*          				        **//
//* modules  					**//
//*          					**//
//************************************************//

//* include('modules/main.php'); *//

function mainModule()
{
    $html_page = array ();

    $html_pageї'title'] = 'demo';
    $html_pageї'content'] = 'demo content';
}

//* include('modules/main.php'); ( end page )*//

//************************************************//
//*          					**//
//* echo output					**//
//*          					**//
//************************************************//

$html_page = mainModule();

$html = new html(&quote;templates/html.tpl&quote;);
$html->setParameter(&quote;html_page_title&quote;, $html_pageї'title']);
$html->setParameter(&quote;html_page_content&quote;, $html_pageї'content']);

echo $html->createHTML(); 
e if its proper or if it will corse problems.

Thanks.

Code: Select all

//************************************************//
//*          					**//
//* includes					**//
//*          					**//
//************************************************//

//* include('system/classes.php'); *//

class html 
{ 
	var $template; 
    var $parameters = array(); 
    
	function html($location) 
	{ 
		$this->template = $location; 
	}
	 
    function setParameter($param, $value) 
	{ 
		$this->parametersї&quote;$param&quote;] = $value; 
	}
	
    function createHTML() 
	{ 
        $html = implode(&quote;&quote;, (file($this->template))); 
        
		foreach($this->parameters as $key => $value) 
		{ 
            $html = str_replace(&quote;{&quote;.$key.&quote;}&quote;, $value, $html); 
        } 
        
		return $html; 
    } 
} 

//* include('system/classes.php'); ( end file ) *//

//************************************************//
//*          				        **//
//* modules  					**//
//*          					**//
//************************************************//

//* include('modules/main.php'); *//

function mainModule()
{
    $html_page = array ();

    $html_pageї'title'] = 'demo';
    $html_pageї'content'] = 'demo content';
}

//* include('modules/main.php'); ( end page )*//

//************************************************//
//*          					**//
//* echo output					**//
//*          					**//
//************************************************//

$html_page = mainModule();

$html = new html(&quote;templates/html.tpl&quote;);
$html-&amll corse problems.

Thanks.

Code: Select all

//************************************************//
//*          					**//
//* includes					**//
//*          					**//
//************************************************//

//* include('system/classes.php'); *//

class html 
{ 
	var $template; 
    var $parameters = array(); 
    
	function html($location) 
	{ 
		$this->template = $location; 
	}
	 
    function setParameter($param, $value) 
	{ 
		$this->parameters["$param"] = $value; 
	}
	
    function createHTML() 
	{ 
        $html = implode("", (file($this->template))); 
        
		foreach($this->parameters as $key => $value) 
		{ 
            $html = str_replace("{".$key."}", $value, $html); 
        } 
        
		return $html; 
    } 
} 

//* include('system/classes.php'); ( end file ) *//

//************************************************//
//*          				        **//
//* modules  					**//
//*          					**//
//************************************************//

//* include('modules/main.php'); *//

function mainModule()
{
    $html_page = array ();

    $html_page['title'] = 'demo';
    $html_page['content'] = 'demo content';
}

//* include('modules/main.php'); ( end page )*//

//************************************************//
//*          					**//
//* echo output					**//
//*          					**//
//************************************************//

$html_page = mainModule();

$html = new html("templates/html.tpl");
$html->setParameter("html_page_title", $html_page['title']);
$html->setParameter("html_page_content", $html_page['content']);

echo $html->createHTML(); 

//************************************************//
thats **//
//* includes **//
//* **//
//************************************************//

//* include('system/classes.php'); *//

class html
{
var $template;
var $parameters = array();

function html($location)
{
$this->template = $location;
}

function setParameter($param, $value)
{
$this->parameters["$param"] = $value;
}

function createHTML()
{
$html = implode("", (file($this->template)));

foreach($this->parameters as $key => $value)
{
$html = str_replace(&quote;{&quote;.$key.&quote;}&quote;, $value, $html);
}

return $html;
}
}

//* include('system/classes.php'); ( end file ) *//

//************************************************//
//* **//
//* modules **//
//* **//
//************************************************//

//* include('modules/main.php'); *//

function mainModule()
{
$html_page = array ();

$html_page['title'] = 'demo';
$html_page['content'] = 'demo content';
}

//* include('modules/main.php'); ( end page )*//

//************************************************//
//* **//
//* echo output **//
//* **//
//************************************************//

$html_page = mainModule();

$html = new html("templates/html.tpl");
$html->setParameter("html_page_title", $html_page['title']);
$html->setParameter("html_page_content", $html_page['content']);

echo $html->createHTML();

//************************************************//



thats my page.u guys please tell me what you think of my code if its proper or if it will corse problems.

Thanks.

Code: Select all

//************************************************//
//*          					**//
//* includes					**//
//*          					**//
//************************************************//

//* include('system/classes.php'); *//

class html 
{ 
	var $template; 
    var $parameters = array(); 
    
	function html($location) 
	{ 
		$this->template = $location; 
	}
	 
    function setParameter($param, $value) 
	{ 
		$this->parameters["$param"] = $value; 
	}
	
    function createHTML() 
	{ 
        $html = implode("", (file($this->template))); 
        
		foreach($this->parameters as $key => $value) 
		{ 
            $html = str_replace("{".$key."}", $value, $html); 
        } 
        
		return $html; 
    } 
} 

//* include('system/classes.php'); ( end file ) *//

//************************************************//
//*          				        **//
//* modules  					**//
//*          					**//
//************************************************//

//* include('modules/main.php'); *//

function mainModule()
{
    $html_page = array ();

    $html_page['title'] = 'demo';
    $html_page['content'] = 'demo content';
}

//* include('modules/main.php'); ( end page )*//

//************************************************//
//*          					**//
//* echo output					**//
//*          					**//
//************************************************//

$html_page = mainModule();

$html = new html("templates/html.tpl");
$html->setParameter("html_page_title", $html_page['title']);
$html->setParameter("html_page_content", $html_page['content']);

echo $html->createHTML(); 

//************************************************//
thats my page.

Posted: Fri Jul 08, 2005 8:31 am
by onion2k
I can't see the point of mainModule(). Hard coding variables into a function is, in my opinion, really annoying.

Posted: Fri Jul 08, 2005 8:35 am
by kylephp
ok, but other wise it looks fine.

Posted: Fri Jul 08, 2005 8:40 am
by onion2k

Code: Select all

$html = implode("", (file($this->template)));
If my template was something like:

Code: Select all

<pre>
IMPORTANT!

This text absolutely must have the carriage returns maintained.

They're vital!
</pre>
That line of PHP would break it..f1]
<pre>
IMPORTANT!

This text absolutely must have the carriage returns maintained.

They're vital!
</pre>

That line of PHP would break 1]
That line of PHP would break it.plate)));
If my template was something like:

Code: Select all

<pre&gt;
IMPORTANT!

This text absolutely must have the carriage returns maintained.

They're vital!
</pre&gt$html = implode("", (file($this->template)));[/php]
If my template was something like:
[code]
<pre>
IMPORTANT!

This text absolutely must have the carriage returns maintained.

They're vital!
</pre>
[/code]
That line of PHP would break it.ng like:
[code]
<pre>
IMPORTANT!

This text absolutely must have the carriage returns maintained.

They're vital!
</pre>
[/code]
That line of PHP would break it.utely must have the carriage returns maintained.

They're vital!
&lt;/pre&gt;
That lsomething like:

Code: Select all

<pre&gt;
IMPORTANT!

This text absolutely must have the carriage returns maintained.

They're vital!
&lt;/pre&gt;
That line of PHP would break it.hing like:

Code: Select all

<pre>
IMPORTANT!

This text absolutely must have the carriage returns maintained.

They're vital!
</pre>
That line of PHP would break it.]
If my template was something like:

Code: Select all

<pre>
IMPORTANT!

This text absolutely must have the carriage returns maintained.

They're vital!
</pre>
That line of PHP would break it.e($this->template)));
If my template was something like:

Code: Select all

&lt;pre&gt;
IMPORTANT!

This text absolutely must have the carriage returns maintained.

They're vital!
</pre>
That line of PHP would break it.mp;lt;pre>
IMPORTANT!

This text absolutely must have the carriage returns maintained.

They're vital!
</pre>
[/codel!
</pre>

That line of PHP would break it.68d5f1]
That line of PHP would break it. (file($this->template)));
If my template was something like:

Code: Select all

<pre>
IMPORTANT!

This text absolutely must have the carriage returns maintained.

They're vital!
&lt;/pre&gt;
That line of PHP would break it.e returns maintained.

They're vital!
</pre&gt;

That line of PHP would break it.ly must have the carriage returns maintained.

They're vital!
</pre>

That line of PHP would break it.5f1]
<pre>
IMPORTANT!

This text absolutely mump;quote;", (file($this->template)));
If my template was something like:

Code: Select all

&lt;pre&gt;
IMPORTANT!

This text absolutely must have the carriage returns maintained.

They're vital!
</pre>
That line of PHP would break it.arriage returns maintained.

They're vital!
</pre>

That line of PHP would break it.le($this->template)));
If my template was something like:

Code: Select all

<pre>
IMPORTANT!

This text absolutely must have the carriage returns maintained.

They're vital!
&lt;/pre&gt;
That line of PHP would break it. (file($this->template)));
If my template was something like:

Code: Select all

&lt;pre&gt;
IMPORTANT!

This text absolutely must have the carriage returns maintained.

They're vital!
&lt;/pre&gt;
That line of PHP would break it."", (file($this->template)));
If my template was something like:

Code: Select all

&lt;pre&gt;
IMPORTANT!

This text absolutely must have the carriage returns maintained.

They're vital!
</pre>
That line of PHP would break it.

Code: Select all

<pre&gt;
IMPORTANT!

This text absolutely must have the carriage returns maintained.

They're vital!
</pre>
= implode("", (file($this->template)));[/php]
If my template was something like:
[code]
&lt;pre&gt;
IMPORTANT!

This text absolutely must have the carriage returns maintained.

They$this->template)));[/php]
If my template was something like:
[code]
<pre>
IMPORTANT!

This text absolutely must have the carriage returns maintained.

They're vital!
</pre>
[/code]
That line of PHP would break it.));[/php]
If my template was something like:
[code]
<pre>
IMPORTANT!

This text absolutely must have the carriage returns maintained.

They're vital!
&lt;/pre&gt;
[/code]
That line of PHP would bis text absolutely must have the carriage returns maintained.

They're vital!
</pre>
[/code]
That line of PHP would break it.$html = implode("", (file($this->template)));[/php]
If my template was something like:
[code]
&lt;pre&gt;
IMPORTANT!

This text absolutely must have the carriage returns maintained.

They're vital!
&lt;/pre&gt;
That line of PHP would break it.

Posted: Fri Jul 08, 2005 8:43 am
by kylephp
so what would you recomment to use.