Tips about a good class-structure for website? (php)

Posted by Martti Laine on Stack Overflow See other posts from Stack Overflow or by Martti Laine
Published on 2010-03-31T16:16:48Z Indexed on 2010/03/31 16:33 UTC
Read the original article Hit count: 223

Filed under:
|

Hello

I'm creating a kind of massive network for users to register and login. I want to try using classes, but I've never used them (expect some mysql-wrappers etc). Could you provide some tips and sample-structure for my project?

The idea is to simply have a index.php, which prints the whole page and does all the action. Index.php calls functions from classes inside other files.

I need:

  • user-class for checking if logged in and retrieving user-info
  • different kind of "page"-classes for functions needed in those pages

I'm not asking for full code, but just a start. I don't know, how to use public functions or anything like that. How to wrap these classes to work together? So no functions, just the structure!

Martti Laine

© Stack Overflow or respective owner

Related posts about php

Related posts about class