1 / 8

Pertemuan 4 Konsep MVC

Pertemuan 4 Konsep MVC. Controller. Membahas :. Instalasi dan Konfigurasi Web Framework Konsep Dasar Controller Aturan Penulisan fungsi. Konfigurasi code igniter. config.php Isi alamat pemanggilan di browser. Dalam contoh ini alamatnya adalah http://localhost/appku

lilah
Télécharger la présentation

Pertemuan 4 Konsep MVC

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Pertemuan 4Konsep MVC Controller

  2. Membahas : • InstalasidanKonfigurasi Web Framework • KonsepDasar Controller • AturanPenulisanfungsi

  3. Konfigurasi code igniter • config.php Isialamatpemanggilandi browser. Dalamcontohinialamatnyaadalah http://localhost/appku $config[’base_url’] = “http://localhost/appku”; • routes.php Variabelinidigunakanuntukmenentukannama file utama yang digunakansebagaiekeskutorutama website atauaplikasi. Contohsecaradefaultnyaadalah file welcome. $route[’default_controller’] = “welcome”;

  4. Konfigurasi code igniter • database.php Isi hostname, username, password dan nama database yang digunakan. • autoload.php File iniberfungsiuntukmemanggilsecaraotomatisfungsi-fungsi yang sudahdisediakan CI atau yang andabuattanpaharusmemanggillnyadalamaplikasianda. contoh : $autoload[’libraries’] = array(’database’);

  5. Alamat URL dalamCodeIgniter • CodeIgnitermenghasilkan clean URL yang mudahdikenalioleh search engine danmanusia. Sebagaicontoh : www.nama-website.com/index.php/blog/post/

  6. Konsepdasar controller • Controller merupakanpenghubungantara Model dan View. Didalam Controller inilahterdapat class danfungsi-fungsi yang memprosespermintaandari View kedalamstruktur data didalam Model.

  7. Alur controller dalammvc

  8. AturanPenulisanFungsi • Penulisan nama class utama harus menggunakan huruf besar di awal dan disimpan dengan nama yang sama ,tetapi menggunakan huruf kecil semua. class Welcome extends Controller { function Welcome() { parent::Controller(); } function index() { $this->load->view(’welcome_message’); } }

More Related