You are here: Re: 2 methods of including files sequence « PHP Programming Language « IT news, forums, messages
Re: 2 methods of including files sequence

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация