More Class Help

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Jr
Forum Commoner
Posts: 99
Joined: Mon Mar 07, 2005 3:25 pm

More Class Help

Post 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?
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

I'd say go for a templating system
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Post 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();
Jr
Forum Commoner
Posts: 99
Joined: Mon Mar 07, 2005 3:25 pm

Post by Jr »

thanks again for the help guys...
Post Reply