First load the library $this->load->library('view');
Then add messages, data, templates etc $this->view->template('admin')->title('Admin control panel')->message->('success','You have successfully logged in')->data($data);
Finally, load the view. Done! $this->view->load();