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

Pipingbag\Routing\Filter\ControllerFactoryFilter::beforeDispatch missing? #10

Closed
btaens opened this issue Apr 27, 2015 · 4 comments
Closed

Comments

@btaens
Copy link

btaens commented Apr 27, 2015

It seems beforeDispatch is missing from the class mentioned in the title.

I'm not sure if I'm doing it wrong, and it's supposed to be this way, but because of this the controller's $request->params is never populated, so I can't find out its' _ext (extension) property, for example, if it was called as an html or json, or something.

@btaens
Copy link
Author

btaens commented Apr 27, 2015

Wait, I'm a moron. It's extending ParentFactory. It's still not populating the params though.

@lorenzo
Copy link
Owner

lorenzo commented Apr 27, 2015

As I told you in the other ticket, you need the latest cakephp in the master branch. Once cakephp 3.0.3 is released, you can require the stable version again :)

@lorenzo lorenzo closed this as completed Apr 27, 2015
@btaens
Copy link
Author

btaens commented Apr 28, 2015

I was using dev-master.

I have found the problem, I was trying to call request on initialize().
It's not exactly a bug, but perhaps it's worth noting in the docs somewhere that because the request object is set after class initialization, request parameters are not accessible at startup (as initialize() gets called during __construct), therefore such operations should be done in beforeFilter(), and not at initialize().
Though now that I encountered this I realized that's bad practice anyway.

@lorenzo
Copy link
Owner

lorenzo commented Apr 28, 2015

Thanks, I will add it to the docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants