Coding conventions on making a small CMS
First post here in the forums ... :)
I am in the stages of building a very small CMS for my needs in order to be able to create websites easy.
I have planned my project very well and structured but my problem is more in the coding conventions since it seems no matter where i look at people PHP codes you see they are unique which is fine but not anwering my question.
In order to clarify what i am after i will present a case i am working right now and would love to hear your suggestions on how to handle the situation.
I am in the part where a build a gallery manager module to my CMS.
I call it gallery.php. the script should be able to create new galleries and edit each gallery items.
i have these calls for the script:
$_GET methods for galleries listing:
- gallery.php? -> reguler call will list the galleries listing
- gallery.php?del=1 -> will delete gallery id which is 1
- gallery.php?edit=1 -> will load the gallery #1 and show items listing
- gallery.php?add=true -> will load the add gallery form
$_GET methods for gallery handling:
- gallery.php?gID=1&del=1 -> will delete item #1 from gallery #1
- gallery.php?gID=1&edit=1 -> will load item #1 for editing and perefences
- gallery.php?gID=1&addItem=true -> will load gallery #1 add item form
all the actions that needed to be saved via add forms and such.
of course there are many types of stuff i need to do but my problem is that using many IF on the script and launching functions seems like a long stupid way.
Wanted to know how you will code this kind of need.
Thanks for you time for reading this.
There is no hard and fast one way to code things like this, it depends on so many different factors that for me to say "do it this way" might very well be different from what someone else might say, which both might be different from what the majority of people do!
How is the rest of your CMS structured? What point are you at with PHP? Have you worked with object-oriented programming before, or are at familiar with the concepts? How would you want to do it, and what are some of the benefits/limitations that you can think of by doing it that way?
|All times are GMT. The time now is 02:41 AM.|
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0