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
Unexpected behavior for request->getRequestTarget() #11977
Comments
Have you tried |
|
So it does. My mistake. When used with I don't use |
I use if($this->request->here == $this->request->getAttribute('webroot')) {
// I'm on homepage
} maybe there is a better method but this is how I did it before :) |
Shouldnt you be using
instead? |
@dereuromark Yes, your suggestion will work well but |
@BassemN For that usage, I think you would want I'm reluctant to add a method to completely reproduce |
Thanks allot :) |
This is a (multiple allowed):
bug
enhancement
feature-discussion (RFC)
CakePHP Version: 3.6.1.
Platform and Target: Apache/2.4.27, MySQL 5.6.37
What you did
I upgraded my App from 3.5 to 3.6. and my app is located into a sub directory called myapp so the full URL is http://development.local/myapp/
What happened
I got a warning error says
Accessing 'here' as a property will be removed in 4.0.0. Use request->getRequestTarget() instead. - /www/myapp/src/Template/Layout/front.ctp, Line 45
so I usedgetRequestTarget()
instead ofhere
What you expected to happen
I expected that
request->getRequestTarget()
will return the same reult fromrequest->here
but this was not the case. As I told you above that my app is localed at http://development.local/myapp/in 3.5 & 3.6,
request->here
returns/myapp/
but on 3.6request->getRequestTarget()
returns/
which is a different result and it should return/myapp/
Thanks
The text was updated successfully, but these errors were encountered: