Advertisement
freddy0512

controller

Mar 20th, 2016
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.47 KB | None | 0 0
  1. <?php
  2. defined('BASEPATH') OR exit('No direct script access allowed');
  3.  
  4. class Welcome extends CI_Controller {
  5.  
  6.    
  7.     public function index()
  8.     {
  9.         $this->load->view('welcome_message');
  10.     }
  11.    
  12.     public function database()
  13.     {
  14.         $query = $this->Model_front->cari_brand(); //query model
  15.         $kota       =  array();
  16.         foreach ($query as $d) {
  17.             $kota[]     = array(
  18.                 'message' => $d->name_brand,
  19.              );
  20.         }
  21.         echo json_encode($kota);      
  22.     }
  23.  
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement