public function __construct(Routing $routing, MyPDO $pdo = null, View $view = null, Layout $layout = null, UserLogged $user_logged = null) { parent::__construct($routing, $pdo, $view, $layout, $user_logged); #cek jika sudah login if ($this->user_logged->check_is_logged()) { #redirect ke halaman profile redirect_to(sprintf('%s/profile', $this->user_logged->get('level'))); } }
public function __construct(Routing $routing, MyPDO $pdo = null, View $view = null, Layout $layout = null, UserLogged $user_logged = null) { parent::__construct($routing, $pdo, $view, $layout, $user_logged); #user harus sudah login if (!$this->user_logged->check_is_logged()) { redirect_to('login'); } #user harus sudah login sebagai siswa if ($this->user_logged->get_level() != 'siswa') { redirect_to('blok-akses'); } }
protected function set_layout(Layout $layout = null) { #set breadcrumb $this->set_breadcrumb(); if ($this->user_logged->check_is_logged()) { #set user logged data then load the layout $this->set_user_logged_data(); } #set navbar kanan $this->set_navbar_right(); parent::set_layout($layout); }
protected function set_layout(Layout $layout = null) { #set user logged data then load the layout $this->set_user_logged_data(); parent::set_layout($layout); }