Programming Theory
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesProgramming Theory

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old August 11th, 2008, 07:57 PM
Naatan Naatan is offline
Registered User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Aug 2008
Posts: 4 Naatan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 45 m 36 sec
Reputation Power: 0
Basic Code Layout for CMS Backend

Hi, I just registered at codewalkers but I've been a long time member of the devshed forums.. I saw that the 2 forums are related and as it seems codewalkers is completely php oriented whilst devshed goes for everyone.

Anyway, about this thread, I am re-doing the basic layout for each backend page of my CMS, the example is for content.php which handles the management of content pages (news articles, regular pages, blogs.. etc).

The CMS is to be 100% object oriented and should be simple to read so that people can be encouraged to make their own modifications and/or plugins.

Please tell me what you think of the following piece of code and if you were to foresee any kind of problems in using it.. the classes and functions are pretty much self explanatory.

PHP Code:
<?php

require('global.php');

class 
Content {
    
    
// Handle POST queries
    
function POST() {
        switch(
$_POST['a']) { // check the 'action' variable
            
case 'doinsert':
                
// do stuff
                
break;
            case 
'doupdate':
                
// do stuff
                
break;
        }
    }
    
    
// Handle GET queries
    
function GET() {
        switch(
$_GET['a']) { // check the 'action' variable
            
case 'insert':
                
Page::Output('Content->Insert');
                break;
            case 
'update':
                
Page::Output('Content->Update');
                break;
        }
    }
    
    
// Default page output
    
function Output() {
        
Template::Output('Content_List');
    }
    
    
// Output create new content
    
function Insert() {
        
Template::Output('Content_Insert');
    }
    
    
// Output update existing content
    
function Update() {
        
Template::setVar('id',$_GET['id']);
        
Template::Output('Content_Update');
    }

?>


Thank you

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesProgramming Theory > Basic Code Layout for CMS Backend


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

Request Your Free Technology Downloads!
 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

Request Your Free Technology Downloads!
 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

Request Your Free Technology Downloads!
 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

Request Your Free Technology Downloads!
 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

Request Your Free Technology Downloads!
 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek