Commit 31c6af5c authored by Mindiell's avatar Mindiell

First basic application

parent 6d2c2d8d
/tmp
app/config.php
<?php
class Controller {
function __construct() {
$f3=Base::instance();
}
// Function called before routing
function beforeRoute($f3, $args) {
}
// Function called after routing
function afterRoute($f3, $args) {
// Rendu HTML de la page
echo Template::instance()->render('base.html');
}
};
<?php
class Main extends Controller {
/*
Main page
*/
function show($f3,$args) {
$f3->set('block_content','home.html');
}
};
[globals]
; Folder containing classes
AUTOLOAD=app/
; Folder containing templates
UI=templates/
; Debug level
DEBUG=3
; Default language
LANGUAGE='fr'
; Global variables of website
<?php
/* Configuration file for Campaign manager */
/* TODO : remove this in production ;) */
error_reporting(E_ALL|E_WARNING);
ini_set("display_errors", true);
?>
[routes]
; Main site
GET @home:/=Main->show
<?php
// Retrieve instance of the framework
$f3=require('lib/base.php');
// Initialize CMS
$f3->config('app/config.ini');
// Define routes
$f3->config('app/routes.ini');
// Execute application
$f3->run();
<include href="header.html" />
<include href="{{ @block_content }}" />
<include href="footer.html" />
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8" />
<meta name="author" content="La Quadrature du Net" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
</head>
<body>
<!-- content -->
Hello world!
<!-- /content -->
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment