Example #1
0
function abort404()
{
    $access = Container::getInstance()->access();
    http_response_code(404);
    view('page404', compact('access'));
    exit;
}
Example #2
0
function teacherController()
{
    $access = Container::getInstance()->access();
    if (!$access->check('teacher')) {
        abort404();
    }
    view('teachers', compact('access'));
}
Example #3
0
function studentController()
{
    $access = Container::getInstance()->access();
    if (!$access->check('student')) {
        abort404();
    }
    view('students', compact('access'));
}
Example #4
0
 public function exercise_test_container_make_with_default_arguments()
 {
     $container = new Container();
     $this->assertInstanceOf(MailDummy::class, $container->make('MailDummy', ['url' => 'styde.net']));
 }
Example #5
0
 public function test_bind_from_class_name()
 {
     $container = new Container();
     $container->bind('key', 'Foo');
     $this->assertInstanceOf('Foo', $container->make('key'));
 }
Example #6
0
function homeController()
{
    $access = Container::getInstance()->access();
    view('index', compact('access'));
}