SeunMatt / codeigniter-log-viewer

This is a simple Log Viewer for viewing Code Igniter logs on the browser and via API clients
MIT License
96 stars 39 forks source link

Issue with initiating the CodeIgniter instance #9

Closed karthikc386 closed 5 years ago

karthikc386 commented 5 years ago

It's the first time I am initiating the CodeIgniter instance in the vendor file

$this->CI = &get_instance(); It return null for me.

image123

Let me know what I am missing here.

SeunMatt commented 5 years ago

Hi @karthikc386 I'm sorry for the late response. Please try the following:

  1. Run composer dump-autoload
  2. Try initiating the CI instance from within your code first e.g. in any of your controllers add this line $this->CI = &get_instance(); then assert that $this->CI is not null by using the is_null() function.

Cheers.

ArmandArthur commented 5 years ago

I have the same error ! What's wrong?

ArmandArthur commented 5 years ago

I forget : parent::__construct(); in my controller.

SeunMatt commented 5 years ago

Good thing you were able to figure it out @ArmandArthur

Hope others will learn from your comments

karthikc386 commented 5 years ago

Thanks. I had the same issue @ArmandArthur.