Framework

The Core

At the heart of the web-frontend of Confusa (yes, you have other sections, the Robotic Interface and the OAuth part). The framework does several things:

The framework relies heavily upon PHPs object-oriented model. Each page that is rendered via the Framework must be a subclass of ContentPage. This then forces the class to implement a set of functions the framework will call.

At a minimum, process() must be implemented, but there are more tools available:

How does Confusa render a given page

The following snippet is a rudimentary approach to what you need to make a page. It will not require authentication, it will be visible for both authenticated users and anonymous.

 1  <?php
 2  require_once 'confusa_include.php';
 3  require_once 'Content_Page.php';
 4  require_once 'Framework.php';
 5
 6  final class CP_Test extends Content_Page
 7  {
 8        function __construct()
 9        {
10                parent::__construct($title = "Test", $protected = false);
11        }
12
13        function process()
14        {
15                $this->tpl->assign('content', "<h1>Hello World</h1>");
16        }
17 }
18 $fw = new Framework(new CP_Test());
19 $fw->start();
20 unset($fw);
21 ?>

Code walkthrough