Advertisement
Guest User

Untitled

a guest
Oct 8th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.84 KB | None | 0 0
  1. # Route untuk paparkan senarai users
  2. Route::get('users', function () {
  3.  
  4.   $page_title = 'Senarai Users';
  5.  
  6.   $senarai_users = [
  7.  
  8.     ['id' => 1, 'nama' => 'Ali Bin Baba', 'email' => 'alibaba@gmail.com', 'phone' => '0123456789'],
  9.     ['id' => 2, 'nama' => 'Abdul Wahab', 'email' => 'abdul@gmail.com', 'phone' => '0123656789'],
  10.     ['id' => 3, 'nama' => 'Sidiq Sigaraga', 'email' => 'sidiq@gmail.com', 'phone' => '016576789'],
  11.     ['id' => 4, 'nama' => 'Chong Wei', 'email' => 'chongwei@gmail.com', 'phone' => '019866789'],
  12.     ['id' => 5, 'nama' => 'Siti', 'email' => 'siti@gmail.com', 'phone' => '0123456559']
  13.  
  14.   ];
  15.  
  16.   # return view('users/template_index', ['page_title' => $page_title]);
  17.  # return view('users/template_index')->with('page_title', $page_title);
  18.  return view('users/template_index', compact('page_title', 'senarai_users'));
  19.  
  20. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement