Controller.php 621 Bytes
Newer Older
Mindiell's avatar
Mindiell committed
1
2
3
4
5
6
7
8
9
<?php

class Controller {
	function __construct() {
		$f3=Base::instance();
    }

    // Function called before routing
    function beforeRoute($f3, $args) {
Mindiell's avatar
Mindiell committed
10
11
12
        // Include configuration
        require_once('config.php');

Mindiell's avatar
Mindiell committed
13
14
15
16
17
18
        // Languages available
        $languages = array(
            array("iso" => "fr", "name"=>"Français"),
            array("iso" => "en", "name"=>"English"),
        );
        $f3->set('languages', $languages);
Mindiell's avatar
Mindiell committed
19
20
21
22
23
24
25
26
27
28
    }

    // Function called after routing
    function afterRoute($f3, $args) {
		// Rendu HTML de la page
		echo Template::instance()->render('base.html');
    }

};