Wiki ⇒ v9 Developer's Manual ⇒ Certified Secure ⇒ Modules ⇒ CPG Dragonfly™ CMS

13.3. 2: Modules Parent


The "documentation/samples/modules/Sample/index.php" contains the base for any module.
If you create your own then the directory name should be changed
We will explain what each part in index.php means.

if (!defined('CPG_NUKE')) { exit; }
Is used to prevent direct access like http://somewhere/modules/Sample/index.php and actualy destroys the request immediately.

$pagetitle .= 'My title';
$pagetitle is a global variable to setup the <title> inside the webpage <head>.
This way the browser shows nice info about the page and as second benefit the SE's (Search Engines) love this.

require_once('header.php');
Open the file header.php which creates and outputs the page header and left side (blocks) for the resulting XHTML page.
NOTE: setting/adding a value to $pagetitle will NOT work after header.php is called because the header is already send to the browser.

If your module isn't template based ($cpgtpl), you may use OpenTable() and CloseTable() to wrap a border around the text that you want to output.

Created: Thursday, April 07, 2005 (20:36:26) by DJMaze
Updated: Thursday, November 24, 2005 (03:10:48) by morph