How to call codeigniter controller function from view

You can call controller function from view in the following way:

Controller:

public function read() {
    $object['controller'] = $this; 
    $this->load->view('read', $object);
}

View:

// to call controller function from view, do
$controller->myOtherFunct();

Leave a Comment