Hello, I did an mvc application but I'm having trouble passing a controller variable to the view. My codes:
class Home extends Controller {
public function index() {
$user = $this->loadModel('usersModel');
$row = $user->getUserData(Session::get('user_id'));
$this->loadView('_templates/header');
$this->loadView('home/index');
$this->loadView('_templates/footer');
}
}
View:
<?php echo $user; ?>