Perkenalan kepada CodeIgniter
Upcoming SlideShare
Loading in...5
×
 

Perkenalan kepada CodeIgniter

on

  • 2,420 views

Penjelasan singkat mengenai codeigniter bagi pemula

Penjelasan singkat mengenai codeigniter bagi pemula

Statistics

Views

Total Views
2,420
Views on SlideShare
2,420
Embed Views
0

Actions

Likes
1
Downloads
174
Comments
1

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />

Perkenalan kepada CodeIgniter Perkenalan kepada CodeIgniter Presentation Transcript

  • Introduction to CodeIgniter Andri Yudatama
  • What is CodeIgniter?
  • CodeIgniter adalah sebuah open source PHP framework dengan pendekatan MVC (Model-View-Controller)
  • MVC adalah sebuah arsitektur pemrograman yang memisahkan fungsi logic, pengolahan data, dan tampilan/kosmetik
  • MVC Application Flow Controller Browser Model Database View
  • MVC Application Flow Controller Browser Model Database View
  • MVC Application Flow Controller Browser Model Database View
  • MVC Application Flow Controller Browser Model Database View
  • MVC Application Flow Controller Browser Model Database View
  • MVC Application Flow Controller Browser Model Database View
  • MVC Application Flow Controller Browser Model Database View
  • MVC Application Flow Controller Browser Model Database View
  • ? Why use framework?
  • ?
  • ? Development lebih cepat
  • ? Development lebih cepat Keseragaman coding
  • ? Development lebih cepat Keseragaman coding Reuseable codes
  • Let’s go DEEPER
  • www.codeigniter.com
  • - [ system ] - [ application ] + [ config ] + [ controller ] + [ errors ] + [ helpers ] + [ hooks ] + [ language ] + [ libraries ] + [ models ] + [ views ] + [ cache ] + [ codeigniter ] + [ database ] + [ fonts ] + [ ... ] + [ user_guide ] + index.php + license.txt File Structure
  • - [ system ] - [ application ] + [ config ] + [ controller ] + [ errors ] + [ helpers ] + [ hooks ] + [ language ] + [ libraries ] + [ models ] + [ views ] + [ cache ] + [ codeigniter ] + [ database ] + [ fonts ] + [ ... ] + [ user_guide ] + index.php + license.txt File Structure
  • URI Structure http://example.com/index.php/page/about_us/ Controller Method
  • Model Sebuah class yang di dalamnya terdapat beberapa fungsi PHP yang biasanya digunakan untuk koneksi ke database dan memanipulasi data (CRUD)
  • <?php class M_karyawan extends Model { function M_karyawan() { parent::Model(); } function get_karyawan() { $query = $this->db->get(‘tabel_karyawan’, 10, 0); if($query->num_rows() > 0) { return $query->result(); } else { return false; } } } Model (system/application/models/m_karyawan.php)
  • <?php class M_karyawan extends Model { function M_karyawan() { parent::Model(); } function get_karyawan() { $query = $this->db->get(‘tabel_karyawan’, 10, 0); if($query->num_rows() > 0) { return $query->result(); } else { return false; } } } Model (system/application/models/m_karyawan.php)
  • <?php class M_karyawan extends Model { function M_karyawan() { parent::Model(); } function get_karyawan() { $query = $this->db->get(‘tabel_karyawan’, 10, 0); if($query->num_rows() > 0) { return $query->result(); } else { return false; } } } Model (system/application/models/m_karyawan.php)
  • Controller Sebuah class yang di dalamnya terdapat beberapa fungsi PHP yang berfungsi sebagai logic untuk mengatur bagaimana aplikasi bekerja
  • <?php class Karyawan extends Controller { function Karyawan() { parent::Controller(); } function get_karyawan() { $this->load->model(‘m_karyawan’); $data[‘karyawan’] = $this->m_karyawan->get_karyawan(); $this->load->view(‘karyawan_view’, $data); } } Controller (system/application/controllers/karyawan.php)
  • <?php class Karyawan extends Controller { function Karyawan() { parent::Controller(); } function get_karyawan() { $this->load->model(‘m_karyawan’); $data[‘karyawan’] = $this->m_karyawan->get_karyawan(); $this->load->view(‘karyawan_view’, $data); } } Controller (system/application/controllers/karyawan.php)
  • <?php class Karyawan extends Controller { function Karyawan() { parent::Controller(); } function get_karyawan() { $this->load->model(‘m_karyawan’); $data[‘karyawan’] = $this->m_karyawan->get_karyawan(); $this->load->view(‘karyawan_view’, $data); } } Controller (system/application/controllers/karyawan.php)
  • View Sebuah file yang menampilkan informasi ke browser Biasanya berupa HTML/CSS/JS dengan beberapa kode PHP
  • <!-- html, head, body tag --> <table> <tr> <td>Nama</td> <td>No Telp</td> </tr> <?php foreach($karyawan as $k): ?> <tr> <td><?php echo $k->nama;?></td> <td><?php echo $k->no_telp;?></td> </tr> <?php endforeach; ?> </table> <!-- /body, /html tag --> View (system/application/views/karyawan_view.php)
  • <!-- html, head, body tag --> <table> <tr> <td>Nama</td> <td>No Telp</td> </tr> <?php foreach($karyawan as $k): ?> <tr> <td><?php echo $k->nama;?></td> <td><?php echo $k->no_telp;?></td> </tr> <?php endforeach; ?> </table> <!-- /body, /html tag --> View (system/application/views/karyawan_view.php)
  • <!-- html, head, body tag --> <table> <tr> <td>Nama</td> <td>No Telp</td> </tr> <?php foreach($karyawan as $k): ?> <tr> <td><?php echo $k->nama;?></td> <td><?php echo $k->no_telp;?></td> </tr> <?php endforeach; ?> </table> <!-- /body, /html tag --> View (system/application/views/karyawan_view.php)
  • Video Tutorial Hello World!
  • Video Tutorial #1 - Hello world!
  • Resources http://www.codeigniter.com http://www.codeigniter.com/user_guide http://www.nettuts.com http://www.smashingmagazine.com http://www.designfellow.com/ (cheat sheet)
  • Questions?