|
Posted by Toby A Inkster on 06/24/07 08:14
webcm123 wrote:
> I'm making some changes in files structure in my CMS. I will use more
> templates for modules. However, the topic of <title> and other ...
> came back when i was thinking about it.
Personally, my modules are PHP objects which must implement some particular
plugin interface which is defined by the CMS. (There are several different
interfaces depending on what the plugin is supposed to do, but I'm going
to describe the "panel" interface, which allows a plugin to add a piece of
content, including a title, to the page.)
object SomePanel
{
public function get_title()
{
// ...
}
public function get_body()
{
// ...
}
}
At the start, the CMS will create a SomePanel object:
require 'plugins/SomePanel.php';
$obj = new SomePanel;
Then when it needs to find the panel's title:
$title = $obj->get_title();
and when it needs to output the panel's body:
echo $obj->get_body();
--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.12-12mdksmp, up 3 days, 11:48.]
A New Look for TobyInkster.co.uk
http://tobyinkster.co.uk/blog/2007/06/22/new-look/
Navigation:
[Reply to this message]
|