echo user in view from sessions code igniter

前端 未结 3 1105
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-27 06:53

I am new in codeigniter. I have implemented a simple login system. I want to print out a username on my view page which is stored in sessions. here is my controller

<         


        
3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-27 07:39

    controller file $data = array( 'username' => $result->name, );

    view file

               session->userdata('username')?> 
    

提交回复
热议问题