Page 1 of 1

More Class Help

Posted: Mon Aug 01, 2005 3:22 pm
by Jr
Ok... I posted a little while ago needing help with PHP Classes. I went through some tutorials and I have a "pretty" good idea of how this stuff works. What I'm having problems with now though is: What is the proper way to include "content" into each page? Should I make another class for each page and extend my main class? or is there a better way to do it?

Say I want to have a fairly large page that has quite a few "case" statements (for editing, deleting, etc). How do you guys (and girls) do it?

Posted: Mon Aug 01, 2005 7:29 pm
by Ambush Commander
I'd say go for a templating system

Posted: Mon Aug 01, 2005 8:32 pm
by josh
Or include your class on every page and have a header and footer method like this:

Code: Select all

require_once("template.inc.php");
$template = new template();
$template -> header();

echo 'Page contents';

$template -> footer();

Posted: Tue Aug 02, 2005 10:19 am
by Jr
thanks again for the help guys...