6
KONFIGURASI CODEIGNITER Klik folder application maka akan tampil: Klik folder config maka akan tampil: Buka file config.php maka akan tampil:

henilei.files.wordpress.com  · Web viewKONFIGURASI CODEIGNITER. Klik folder application maka akan tampil: Klik folder config maka akan tampil: Buka file config.php maka akan tampil:

  • Upload
    ngodung

  • View
    226

  • Download
    0

Embed Size (px)

Citation preview

Page 1: henilei.files.wordpress.com  · Web viewKONFIGURASI CODEIGNITER. Klik folder application maka akan tampil: Klik folder config maka akan tampil: Buka file config.php maka akan tampil:

KONFIGURASI CODEIGNITER

Klik folder application maka akan tampil:

Klik folder config maka akan tampil:

Buka file config.php maka akan tampil:

Page 2: henilei.files.wordpress.com  · Web viewKONFIGURASI CODEIGNITER. Klik folder application maka akan tampil: Klik folder config maka akan tampil: Buka file config.php maka akan tampil:

Lalu buka lagi file routes file welcome.php

Isi file routes: default controller adalah file welcome.php yang terdapat pada folder application

controllers

Page 3: henilei.files.wordpress.com  · Web viewKONFIGURASI CODEIGNITER. Klik folder application maka akan tampil: Klik folder config maka akan tampil: Buka file config.php maka akan tampil:

Isi file welcome.php:

Karena welcome.php adalah default controller sehingga dapat dipanggil dengan cara ketik :

http://localhost/codeigniter/

file welcome.php dapat juga dipanggil dengan cara:

http://localhost/codeigniter/index.php/welcome.php

function index() pada file welcome.php di atas dapat dipanggil dengan cara:

http://localhost/codeigniter/index.php/welcome.php/index

Page 4: henilei.files.wordpress.com  · Web viewKONFIGURASI CODEIGNITER. Klik folder application maka akan tampil: Klik folder config maka akan tampil: Buka file config.php maka akan tampil:

Latihan

Buat file web.php lalu simpan pada folder application, ketik kode berikut:

Panggil dengan cara: http://localhost/codeigniter/index.php/Web

Jika dipanggil dengan cara: http://localhost/codeigniter maka default controller pada file routes.php

harus diubah menjadi “web”.

Function index() dapat dipanggil dengan cara: http://localhost/codeigniter/index.php/Web/index

Function cetak() dapat dipanggil dengan cara: http://localhost/codeigniter/index.php/Web/cetak

Pada gambar di atas function parameter() memiliki argumen/parameter bernama “satu”, oleh karena itu

jika dipanggil harus menyebutkan nilai parameternya, misal henilei:

http://localhost/codeigniter/index.php/Web/parameter/henilei

Page 5: henilei.files.wordpress.com  · Web viewKONFIGURASI CODEIGNITER. Klik folder application maka akan tampil: Klik folder config maka akan tampil: Buka file config.php maka akan tampil:

Cara memanggil function prm1(): http://localhost/codeigniter/index.php/Web/prm1/heni/leidiyana

Jika ingin memanggil tanpa nilainya maka nilai parameternya ditulis pada program seperti function

prm2() sehingga dapat dipanggil dengan cara: http://localhost/codeigniter/index.php/Web/prm2 tanpa

menuliskan nilainya.