Page 1 of 1

Index - PHP

Posted: Mon Feb 28, 2011 7:55 pm
by KDD8
The portion that is commented out, for some reason won't generate the page when it's implemented.. It doesn't break, but anything after that doesn't function - Any advise?

Code: Select all

<?php
	require_once('Template.php');
	class Page {
		protected $content = '';
		
		public function __construct() {
		
		}
		
		public function setContent($html) {
			$this->content = $html;
		}
		
		public function generate() {
				
			$mtmpl = new Template();
			$mhtml = $mtmpl->build('menu.tmpl');
			
			$mltmpl = new Template();
			$mlhtml = $mltmpl->build('menuleft.tmpl');
			
			$ttmpl = new Template();
			$thtml = $ttmpl->build('top.tmpl');
			
			$ptmpl = new Template();
			$ptmpl->menu = $mhtml;
			$ptmpl->menuleft = $mlhtml;
			//$ptmpl->top = $ttmpl;
			
			$ptmpl->content = $this->content;
			print $ptmpl->build('page.tmpl');
		}
	
	
	
	}
?>

Re: Index - PHP

Posted: Mon Feb 28, 2011 8:30 pm
by KDD8
Solution: $ptmpl->top = $ttmpl;
should be $ptmpl->top=$thtpml;

Re: Index - PHP

Posted: Mon Feb 28, 2011 8:42 pm
by Weirdan
KDD8 wrote:Solution: $ptmpl->top = $ttmpl;
should be $ptmpl->top=$thtpml;
You seriously need to improve your variable naming skills.