Connecting Tech Pros Worldwide Forums | Help | Site Map

Im stuck with a page class

[Mystic]
Guest
 
Posts: n/a
#1: Jul 17 '05
Hi (again).

I've created a page class for dynamicly making pages. It works fine apart
from one problem im having.

I'm making it include the main body of the page from an html file.

So: $test = new page('Page Title','filename.html');

$test->PrintHtml();

This will now include my filename.html

in filename.html I had $test->getTitle(); to get the title for the webpage,
however, if the var $test is something else, this will not work. Also, if I
do not make it global it will not work. Is there an easier way of doing
this?

Another way I thought of was replacing certian values like replacing <TITLE>
with the title etc. But I wan't this class to be dynamic, so i don't want to
this this if I dont have to.

Thanks.



ganeshg
Guest
 
Posts: n/a
#2: Jul 17 '05

re: Im stuck with a page class


Use Smarty template engine (http://smarty.php.net/) unles you are learning
PHP. Smarty is more reliable and bug free, then home made scripts.


Closed Thread