Example #1
0
    /**
     * Get Config
     */
    require_once APP_DIR . '/config.php';
    /**
     * Instantiate Controller & theme
     */
    $controller = new Controller($path, $index);
    $theme = new Theme($path, $index);
    /**
     * Include functions & classes
     */
    require_once APP_DIR . '/core/includes.php';
    if (ENVIRONMENT === 'development') {
        $theme->setDebug(true);
    }
    /**
     * Get template file
     */
    $template = $theme->load($path);
    /**
     * Load Controller file
     */
    require $controller->load($path);
    /**
     * Render the Page
     */
    $theme->render($template, $variables->get());
} catch (Exception $e) {
    echo '<script>console.log("PHP Exception: ' . $e->getMessage() . '");</script>';
}