Anda di halaman 1dari 4

CARA MEMBUAT HMVC DI CODEIGNITER

Langkah langkah sebagai berikut :


1. Download codeingiter lihat struktur foldernya, ganti nama folder menjadi folder CI
tersebut menjadi hmvcExample.

2. Cari file htdocs\hmvcExample\application\config\config.php, kemudian tambahkan


script berikut :
3. Kemudian
jalankan
melalui
http://localhost/hmvcExample

web

browser

dengan

memanggil

4. Plugin HMVC kemudian copykan file ke :


a. Dari hmvc\core

Ke hmvcExample\application\core
Sehingga hasilnya sebagai berikut :

b.

Kemudian copykan dari plugin hmvc\third_party


Ke hmvcExample\application\third_party
Sehingga hasilnya sebagai berikut :

5. Sehingga tampilan struktur folder di hmvcExample sebagai berikut :

6. Setelah itu, sisipkan code dibawah di file application/config/config.php

7. setelah itu buat file dalam folder application/modules/nama_module/controllers, sehingga


struktur foldernya sebagai berikut :

8. Buat file produk.php di dalam hmvcExample\application\modules\produk\controllers


kemudian isikan script berikut :

9. Dan buat file beranda.php di dalam hmvcExample\application\modules\produk\views

10. Buka file application/config/routes.php, ganti parameter sebagai berikut :

11. Kemudian panggil di web browser http://localhost/hmvcExample

Anda mungkin juga menyukai