Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: initController not called in ResourceController #2404

Closed
aryaei2000 opened this issue Nov 14, 2019 · 3 comments
Closed

Bug: initController not called in ResourceController #2404

aryaei2000 opened this issue Nov 14, 2019 · 3 comments
Labels
bug Verified issues on the current code behavior or pull requests that will fix them

Comments

@aryaei2000
Copy link

Describe the bug
When extending ResourceController in a new controller, the initController is not called as the constructor.

CodeIgniter 4 version
4.0.0-rc.2.1

Affected module(s)
CodeIgniter\RESTful\ResourceController

Expected behavior, and steps to reproduce if appropriate
initController is supposed to be called on the event of creation of a new instance of the class.

Context

  • OS: Windows 10
  • Web server Apache 2.4.39 (Wamp)
  • PHP version 7.2.18
@aryaei2000 aryaei2000 added the bug Verified issues on the current code behavior or pull requests that will fix them label Nov 14, 2019
@dafriend
Copy link
Contributor

It would be very helpful if you could provide code for a minimal, reproducible example. I think that means not only the controller extending ResourceController but probably also ResourceController itself along with any parents it might have.

@lonnieezell
Copy link
Member

Code would definitely be helpful since I don't currently see any way this could be true.

ResourceController calls it's parent initController method.
And initController is called by the main loop on all controllers when it instantiates it.

@lonnieezell
Copy link
Member

I just did a simple test: made the default Home controller that CI ships with extend ResourceController and everything loads as expected. I extended the initController method, and it's tried to run it as expected.

Cannot find this a bug. Sorry. Post on the forums if you're stuck to get help with your situation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified issues on the current code behavior or pull requests that will fix them
Projects
None yet
Development

No branches or pull requests

3 participants