How you will use or add codeigniter libraries?

How you will use or add codeigniter libraries?

Team Leader Asked on February 12, 2017 in CODEIGNITER.
Add Comment
1 Answer(s)

You can try this
The file Message.php in application/libraries:

 

class Message{
function display_message()

{

return 'Welcome to my Dashboard';

}

}


Controller dashboard.php in application/controllers


class Dashboard extends CI_Controller

{

function index()

{

$this->load->library('message');

echo $this->message->display_message();

}

}

Senior Developer Answered on February 12, 2017.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.