You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What do I need to do in order to call the parent constructor in my controller. I want to declare variables accessible to all of the functions inside the controller. Sorry I'm just new to CodeIgniter 4.
Support questions should be asked over at the forum. However, since you thought it was a bug I'll give you a quick overview.
Assign anything you need available with the BaseController constructor. And that's pretty much it. If you need to do something in a controller that extends BaseController, then you should call parent::__construct(), but only after you've created a constructor in BaseController.
Where did you see that in the docs? We likely need to modify something there.
I'm so sorry I've been reading the CI user guide from a different website, I realized it just now. My problem is solved now thank you. It's just I'm having a bit of a hard time transitioning from CI3 to CI4 and couldn't find much answers related to my problem from the internet. I'll be closing this now. My bad.
I'm trying to call a parent constructor on my controller but it doesn't seem to work. I followed what the documentation tells. Here is my code:
I'm not sure if it's just me or there something wrong with my PHP version I'm working on.
And this is the error message:
Context
The text was updated successfully, but these errors were encountered: