Best approach for building custom CMS using PHP!

Hi Guys,

I am looking to build a CMS from the scratch using PHP 5.3. I am going to use the Object Oriented Programming approach. I have a few questions and thought to post on CF to get your ideas. For example the CMS is about Games website, Do you think the following Class structure is good?

  1. Admin Class
    Will hold the Admin_Login, Admin_Logout etc Methods

  2. Admin_Games (will extend Admin Class)
    Will hold the Add_Game, Update_Game, Delete_Game methods

  3. Admin_Users (will extend Admin Class)
    Will hold the Add_User, Update_User and Delete_User methods

Similarly for the front-end

  1. Site Class
    Will hold normal features such as Login/Logout, Page Views etc.

  2. View Games Class (will extend Site Class)
    Will hold View_Game, Rate_Game and Play_Game methods.

Is this approach good?

This isn’t Coding Forums, muneeba9071. :stuck_out_tongue:

Is there something none of the seasoned CMSs can address for you?

I actually don’t want to restrict myself to follow the way of Frameworks or open source CMS’s I just want to do everything the simple way, just want opinions regarding the approach.

I can understand you want freedom from a pre-baked CMS and for that I think you are correct, but from your questions I would suggest you build your CMS on an established MVC-based PHP framework to get started.

This will force you to think about separating the different “layers” of your application, and provide some of the basic wiring so that you are free to create the library of classes you think you will need.

Dont you already have the makings of a library of classes that you depend upon?

More …

Sorry, I did not read you last post correctly, you don’t want to use a Framework either.

If that is because you know better, then you wouldn’t be asking us how to go about starting, so I will go ahead and presume you still feel fettered by having to follow some kind of convention.

Perhaps if you imagine your classes should evolve from the bottom up and not have to conform to what seems a logical top down diktat, you might get on to coding quicker.

But when I see:

  1. Admin_Games (will extend Admin Class)
    Will hold the Add_Game, Update_Game, Delete_Game methods

These seem to scream out Data Access Objects, and should be part of a Model - if you don’t want to do MVC then there are other acceptable meta-patterns you know.

Why not develop just a Model (which encapsulates business rules and data access) and a simple templater, then dream something up to connect the two and go your own way on that?