user2365514
user2365514

Reputation: 465

How to call another Codeigniter Class/function from other Codeigniter

I want to call A (Codeigniter) login Class and it functions from B Codeigniter. Anyone can explain and share idea how can do this. Thanks

Upvotes: 1

Views: 12941

Answers (2)

Nehil Mistry
Nehil Mistry

Reputation: 1109

This question is similar to:

How to load a controller from another controller in codeigniter?

or Codeigniter call function within same class

Try this, you will get solution.

Upvotes: 1

Murari Pradip Singh
Murari Pradip Singh

Reputation: 39

<?php 
class MY_Controller extends CI_Controller {
  public function is_logged()
  {}
}

class Home_Controller extends MY_Controller {
    public function show_home()
    {
         if (!$this->is_logged()) {
           return false;
         }
    }
}
?>

Upvotes: 0

Related Questions