예제 #1
0
 function index()
 {
     if (Auth::guest()) {
         $this->app->flash('info', "You must be logged in to view the admin page.");
         $this->app->redirect('/');
     }
     if (!Auth::isAdmin()) {
         $this->app->flash('info', "You must be administrator to view the admin page.");
         $this->app->redirect('/');
     }
     $variables = ['users' => User::all()];
     $this->render('admin.twig', $variables);
 }
예제 #2
0
 function all()
 {
     $users = User::all();
     $this->render('users.twig', ['users' => $users]);
 }