Why is Request Object empty
- Bill Lions
- Member | 47
Why is the request object an giving me an empty array?
/blog/show/2
The route is fine, and if I manually set the response, it works, but I need to get the blog id from the query string.
Thanks, Bill
- CZechBoY
- Member | 3608
read this and it should be clear after reading
https://doc.nette.org/…n/presenters#…
- Bill Lions
- Member | 47
Tracy also reports
I can see initially, the request is null as a default, but then is 3 in the “Matched as” column, (as specified in the url).
Am I somehow trying to get the value before it is set? Is that even possible?
- Bill Lions
- Member | 47
So, on further investigation I came up with a solution that did not require the use of the request object to gain the id parameter…
There is some else conditions for the if statements, but that is the gist of
it.
Is this the ‘correct/nette’ way to do this?
Passing the parameter to the action?
- CZechBoY
- Member | 3608
You should dump $user->getIdentity()
I dont get why you use action for ajax, use handle methods https://doc.nette.org/…ication/ajax
- Bill Lions
- Member | 47
Thanks, I was previously unaware of these handle methods.
Only been using nette for a week :)