Controller of CodeIgniter Reviewed by Momizat on . A controller can send commands to the model to update the model's state. It can also send commands to its associated view to change the view's presentation of t A controller can send commands to the model to update the model's state. It can also send commands to its associated view to change the view's presentation of t Rating: 0

Controller of CodeIgniter

A controller can send commands to the model to update the model’s state. It can also send commands to its associated view to change the view’s presentation of the model.

<?php 
 if ( ! defined('BASEPATH')) exit('No direct script access allowed');
 
class Main extends CI_Controller {
 
    function __construct()
    {
        parent::__construct();
        $this->load->helper('url','form','html','cookie');        
        $this->load->library(array('session','email'));
        $this->load->model(array("user_model")); 
                 
    }  
 
    public function index()
    {
/*

$to="manish@phpshortnotes.com";
$config['mailtype'] = 'html';
$from="support@phpshortnotes.com";	
$subject="Guest Comment";
$emailbody=$this->load->view("templates/reviews",$data,true);
$this->email->initialize($config);			
$this->email->from($from);
$this->email->to($to);
//$this->email->cc("mustafa@phpshortnotes.com");
//$this->email->bcc(array("ravi@phpshortnotes.com","manish@phpshortnotes.com"));
$this->email->subject($subject);
$this->email->message($emailbody);
$this->email->send();
*/               
        $data['result']=$this->user_model->getallusers();
        $this->load->view('dashboard',$data); 
    }


}
?>

Leave a Comment

© 2014 Powered By