Exemplo n.º 1
0
function site_routing($routes)
{
    global $smarty;
    $smarty->assign('currentRoute', $routes[1]);
    if ('home' == $routes[1] || '' == $routes[1]) {
        home_action();
    } elseif ($routes[1] == 'creations') {
        creations_action();
    } elseif ($routes[1] == 'contact') {
        contact_action();
    } else {
        header('Status: 404 Not Found');
        error404_action();
    }
}
Exemplo n.º 2
0
<?php

//charge et initiale les bibliotheques globales
include 'setting.inc.php';
$command = get_command();
$routes = get_routes($command);
if ($routes[0] == '') {
    // lire le code de langue
    $the_lang = get_lang();
    redirect($the_lang . '/home');
} elseif ($routes[0] == 'fr') {
    switch_lang('fr');
    display_text();
    site_routing($routes);
} elseif ($routes[0] == 'en') {
    switch_lang('en');
    display_text();
    site_routing($routes);
} elseif ($routes[0] == 'es') {
    switch_lang('es');
    display_text();
    site_routing($routes);
} else {
    header('Status: 404 Not Found');
    error404_action();
}