function __construct()
 {
     parent::__construct(array('@^customers$@' => 'showCustomers', '@^customers/(?<id>\\d+)$@' => array('get' => 'editCustomer', 'post' => 'updateCustomer'), '@^customers/(?<id>\\d+)\\b@' => function () {
         self::handleRoute('CustomerOrdersController');
     }));
     $this->pdoCustomer = new PDOCustomer();
 }
 function __construct()
 {
     parent::__construct(array('@^admin\\b@' => function () {
         if (!$loggedIn) {
             header('Location: ' . Route::getFrontControllerPath() . '/login');
             exit;
         }
         // Return false, so the next route is also evaluated.
         return false;
     }, '@^admin$@' => 'showAdminIndex'));
 }
Exemplo n.º 3
0
 function __construct()
 {
     parent::__construct(array('@^$@' => 'index'));
 }
 function __construct()
 {
     parent::__construct(array('@^customers/(?<id>\\d+)/orders$@' => function ($args) {
         die('Orders from customer ' . $args['id']);
     }));
 }