TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   Advanced PHP Programming (http://www.talkphp.com/advanced-php-programming/)
-   -   Coding conventions on making a small CMS (http://www.talkphp.com/advanced-php-programming/4841-coding-conventions-making-small-cms.html)

Arye 08-11-2009 08:43 PM

Coding conventions on making a small CMS
 
Hi all,

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

$_POST

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.


$_POST methods:

Salathe 08-11-2009 09:09 PM

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