INSTALASI
1. Siapkan Framework CodeIgniter terlebih dulu (Download disini)
2. Download Omaps-CI
3. Extract Omaps-CI di dalam folder Root Codeigniter dan Sususan forldernya akan menjadi seperti ini
![]() |
![]() |
4. Test dengan cara jalankan kembali codeigniter di browser dan kita akan mendapatkan simple tempate yang bisa kita edit sesuai dengan keinginan.
KONFIGURASI OMAPS-CI
Buka config.php Folder (application/config)
/* |-------------------------------------------------------------------------- | Assets Path |-------------------------------------------------------------------------- | | Assets path of website | */ $config['assets'] = 'assets'; /* |-------------------------------------------------------------------------- | Theme name |-------------------------------------------------------------------------- | | Name of Theme Websites. | */ $config['theme'] = 'omap-ci'; /* |-------------------------------------------------------------------------- | Admin Theme name if any |-------------------------------------------------------------------------- | | Name of Admin Theme Websites. | */ $config['admin_theme'] = ''; /* |-------------------------------------------------------------------------- | HTML COMPRESSOR |-------------------------------------------------------------------------- | | Omaps-CI HTML Compressor | */ $config['html_comperssor'] = FALSE;
$config['theme'] = 'omap-ci'; --> Setting theme utama yang kita pakai
$config['admin_theme'] = 'front'; --> Setting Admin_theme jika ada. Default Kosong
$config['html_comperssor'] = FALSE; --> Buat compress HTML (if TRUE) FALSE html tidak dicompresss
$config['assets'] = "" --> Isi jika assets diperlukan
MEMBUAT SIMPLE MODULES
$this->omap->type('modules');
$this->omap->title('any title');
$this->omap->display('any modules');
Contoh :
Buat Controller di application/controllers/mod_product.php (Nama file harus sama dengan nama class)
class Mod_product extends CI_Controller { public function __construct() { parent::__construct(); } public function index() { $this->omap->type('modules'); $this->omap->title('Daftar produk yang berelasi'); $this->omap->display('mod_product'); } }
Buat viewes di application/views/modules/mod_produk.php (lihat $this->omap->display(mod_produk) karena type modules maka di tempatkan di folder views/modules)
Ini Adalah Modules Produk
MEMBUAT SIMPLE PAGES
$this->omap->title('any title');
$this->omap->label('any label');
$this->omap->display('any pages');
Buat Controller di application/controllers/product.php (Nama file harus sama dengan nama class)
class Product extends CI_Controller { public function __construct() { parent::__construct(); } public function index() { $this->omap->label('dasbor'); $this->omap->title('Daftar Produk'); $this->omap->display('page_produk'); } }
Buat viewes di application/views/pages/page_produk.php (lihat $this->omap->display('page_product') karena type pages maka di tempatkan di folder views/pages)
Ini adalah halaman Product
di forder template/omap-ci/index.php ( Misal Template yang di pake bernama omap-ci (Lihat konfigurasi diatas) letakan controller pages yang sudah kita buat tadi dengan cara menuliskan {DASBOR} -> (lihat $this->omap->label('dasbor')) dan tempatkan sesuai dengan keinginanmu )
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>{TITLE}</title> <!-- <meta name="viewport" content="width=device-width, initial-scale=1.0"> --> <link href="{SITE}bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" /> <link href="{STYLE}style.css" rel="stylesheet" type="text/css" /> <!-- <link href="{SITE}bootstrap/css/bootstrap-responsive.css" rel="stylesheet"> --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script> </head> <body> {DASBOR} </body> </html>
Panggil & testing pages di browser http://YOUR_SITE/index.php/product
YOUR_SITE = misal http://localhost/xxx
product = nama class dari controller di panggil lagi
MEMBUAT SIMPLE PAGES & MENAMBAHKAN BEBERAPA MODULES
$mod[] = mod('any modules');
$mod[] = mod('any modules');
$this->omap->modules(build_modules($mod));
$this->omap->title('any title');
$this->omap->label('any label');
$this->omap->display('any pages');
Misal kita sudah membuat beberapa modules ( mod_product, mod_category, mod_login ) dan kemudian kita include / kita gabungankan beberapa modul tersebut kedalam pages
class Product extends CI_Controller { public function __construct() { parent::__construct(); } public function index() { $mod[] = mod('mod_product'); $mod[] = mod('mod_category'); $mod[] = mod('mod_login'); $this->omap->modules(build_modules($mod)); $this->omap->label('dasbor'); $this->omap->title('Daftar Produk'); $this->omap->display('page_produk'); } }
Di forder template/omap-ci/index.php ( Tambahkan modules yang telah kita inculde di controllers lihat $mod[] = mod('mod_product') dan seterusnya ) nama modul akan menjadi label yang siap kita panggil di template utama
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>{TITLE}</title> <!-- <meta name="viewport" content="width=device-width, initial-scale=1.0"> --> <link href="{SITE}bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" /> <link href="{STYLE}style.css" rel="stylesheet" type="text/css" /> <!-- <link href="{SITE}bootstrap/css/bootstrap-responsive.css" rel="stylesheet"> --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script> </head> <body> <div>{MOD_PRODUCT} {MOD_CATEGORY} {MOD_LOGIN}</div> <div>{DASBOR}</div> </body> </html>