Ejemplo n.º 1
0
<?php

class CustomerController
{
    public function __construct()
    {
    }
    public function index()
    {
        include ROOT_PATH . "/views/customer/index.php";
    }
}
$customercontroller = new CustomerController();
if (isset($_GET['m'])) {
    $method = $_GET['m'];
} else {
    $method = "index";
}
switch ($method) {
    case 'index':
        $customercontroller->index();
        break;
    default:
        $customercontroller->index();
}
Ejemplo n.º 2
0
});
//Vastaanottajat
$routes->post('/receiver', function () {
    ReceiverController::store();
});
$routes->get('/receiver/new', function () {
    ReceiverController::create();
});
$routes->get('/receiver', 'check_logged_in', function () {
    ReceiverController::index();
});
// Lähettäjät
$routes->post('/customer', function () {
    CustomerController::store();
});
$routes->get('/customer/new', function () {
    CustomerController::create();
});
$routes->get('/customer', 'check_logged_in', function () {
    CustomerController::index();
});
// Listaa kaikki rahtikirjat
$routes->get('/waybill', 'check_logged_in', function () {
    WaybillController::index();
});
$routes->get('/', 'check_logged_in', function () {
    HelloWorldController::index();
});
$routes->get('/hiekkalaatikko', function () {
    HelloWorldController::sandbox();
});