Install dependencies:
composer update
Taroh di /application/views/
Contohnya ada seperti di file /application/controllers/Welcome.php
:
public function halo(){
$this->view('beranda/index');
}
Di controller:
public function panggil($nama = 'Zen'){
$this->view('beranda/panggil', compact('nama'));
}
Di view:
extends ../layout/default.pug
block isi
h1 Hello #{nama}
Contoh link: http://localhost:2020/welcome/panggil/Aurel
. Hasilnya:
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"><title>Hello world</title></head><body><h1>Hello Aurel
</h1></body></html>
public function halo(){
$this->session->set_userdata('nama', 'Zen');
$userdata = $this->session->userdata('nama');
$this->view('beranda/index', compact('userdata'));
}
- Markdown (dengan
:markdown
) - Stylus (dengan
:stylus
). Kalau yang Stylus ini, nggak perlu pakaistyle
lagi. Dia ketambah otomatis