Welcome Guest, Not a member yet? Register   Sign In
Restored old site but new errors shown
#10

(This post was last modified: 09-10-2021, 02:40 PM by includebeer.)

I'm not sure why it worked before and now it's not. But it's not good practice to access a variable defined in another file and taking for granted that the variable will exist and be accessible. There may be a setting in php.ini that prevent this behavior and keep the scope to a single file?

But anyway, loading a library with require_once in the constructor, then trying to access $this->options is very bad coding. It would be best to properly load the library, then change this code to a function that return a value and assign that value to $options in MY_Controller class.

...in fact, this may be in the "libraries" folder, but it's really a configuration file and not a library. This look like it was hacked together by someone that knows nothing about CodeIgniter. You better fix this nonsense the right way or you'll end up with a lot of weird bug like this.
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/
Reply


Messages In This Thread
RE: Restored old site but new errors shown - by includebeer - 09-10-2021, 02:39 PM



Theme © iAndrew 2016 - Forum software by © MyBB