tags:

views:

49

answers:

3

I want to create a simple PHP website containing quite a number of pages. The content of the pages will be editable by the admin(s) of the website using a simple online html text editor.

There should also be members, managed by the admin. (No self-registration)

There is also a members section with login.

Obviously this is not complicated to do procedurally, but I would like to try using classes.

Why should I even use PHP classes in this case? And where would they be useful? Or is there no good reason to use them for such a site?

Thanks

+1  A: 

Using OOP principles even in small projects can help you fully understand the benefits of such Programming principles. Although the problem may be easy to solve procedural, it would be an extension and maintenance nightmare.

So:

  • Think about your classes and their relations before coding (Maybe even draw some UML charts)
  • Have a look at various design patterns, maybe one fits your problem here
  • Stick to your design while coding ;)
Tapdingo
A: 

To use classes makes sense if it is easier to use a class than to do something without (and for reusability if needed). Sure you could go without classes, but for example for your user management (your members) there are some helpfull classes to use.

Thariama
+1  A: 

Why:
http://stackoverflow.com/questions/135535/what-are-the-benefits-of-oo-programming-will-it-help-me-write-better-code, and
http://stackoverflow.com/questions/84125/oo-php-explanation-for-a-braindead-n00b

MattBianco
Thanks. The odd thing is, with desktop apps I use classes intensively. I just can't figure out why I would use them for PHP sites. But these comments will help.
Michael Frey