Posted by C. on 01/12/07 10:53
Sharon O. wrote:
> 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"); ?>
>
(three dots?)
> Content of cms.php::
> <title>...<body>...pretty pictures...
> <? if ($url = /pages/foo.php) { include (".../pages/foo.inc.php"); ?>
> </body>
>
> foo.inc.php then contains the actual content:
> <h2>About us</h2><p>We are...
>
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.
C.
Navigation:
[Reply to this message]
|