Pass data from a function in a model to a controller in Codigniter

  • A controller in MVC (Model View Controller) is responsible for the application flow of the program.
  • Suppose you made a request in MVC pattern like structure, the controller is responsible for returning the response to the view.
  • The controller can different types of values based on the application request.
  • A controller is actually a coordinator between the model and view


    public function Profile() {
       $data['email'] = $this->profileModel->getEmail(); 


    public function getEmail() {
	   $email = '';
	   return $email;