Example #1
0
 public static function i($name)
 {
     if (self::$i == NULL) {
         $classname = 'Page' . ucfirst($name);
         self::$i = new $classname($name);
     }
     return self::$i;
 }
Example #2
0
<?php

session_start();
require_once "init.php";
if (isset($_GET['_ajc'])) {
    $parts = explode('::', $_GET['_ajc']);
    if (!empty($parts[0]) && !empty($parts[1])) {
        $method = 'ajax' . ucfirst($parts[1]);
        $renderer = Page::i($parts[0]);
        echo json_encode($renderer->{$method}());
    }
} else {
    $page = Data::get('_page', "main", Data::STR);
    Page::i($page)->display();
}