CMS Design

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I'm currently using my own method to make a CMS work as follows:

User wants to open /pages/foo.php.  

Content of foo.php:
 <? include (".../includes/cms.php"); ?>

Content of cms.php::
 <title>...<body>...pretty pictures...
 <? if ($url = /pages/foo.php) { include (".../pages/"); ?>
 </body> then contains the actual content:
 <h2>About us</h2><p>We are...

As you can see foo.php simply opens the CMS script. The CMS script then
handles giving the website design to the browser, then it works out where
the needed page containing the content is from the URL.  

This works fine but is this a better way anyone could suggest I use?

Re: CMS Design

Sharon O. wrote:
Quoted text here. Click to load it

(three dots?)

Quoted text here. Click to load it

Using two seperate files to describe the page contents is something of
an overhead.

One solution would be to use a front controller for the code within
cms.php, but personally, I'm not a fan of this pattern.

I'd go with implementing cms.php within a template or alternately using
a calback from cms.php to foo.php to render the page specific elements.


Site Timeline