I have a function in my controller that retrieves User name here:
public function getUserName(){
$user_id = $this->session->userdata('user_id');
return $this->user_model->sban_name($user_id);
}
Now, what I want is to put it directly inside an HTML tag like this,
<a href="#"><?php echo getUserName();?></a>
But, it's not working. Is there any other way to do it?
helperand load it in yourcontrollerand call it in yourview.redirect('your_view',$data);