-
-
Notifications
You must be signed in to change notification settings - Fork 236
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
Added possibility to store other request then the current one #1219
Conversation
👍 for the feature, but 👎 for implementation as it looks too hacky. |
@Majkl578 Huh? How would you implement it then? I'm actually thinking about hacking it even more so that the first parameter would be optional. EDIT: Yeah, switching the parameters order probably would be better. (I've thought about that as well actually.) @dg Which way do you want me to implement it? |
|
@Majkl578 Is it ok now in your opinion? :-) |
{ | ||
// first parameter is optional | ||
if ($request !== NULL && !$request instanceof Application\Request) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NULL
check is unnecessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is necessary because of a call with no parameters. The default expiration would be overwritten with the NULL.
@Majkl578 What about this then? if ($request === NULL) {
$request = $this->request;
} elseif (!$request instanceof Application\Request) {
$expiration = $request;
$request = $this->request;
} |
@dg Majkl and I both think this other way is more readable so I force-pushed it. It's ready to merge imho. |
ping @dg |
Fixed typo in commit message. |
I realized that the logic I had in ErrorPresenter shouldn't be there so I moved that elsewhere making this feature useless. |
@enumag: It is not useless for me, so could you please reopen it? |
@Majkl578 ok |
One mine use case is indirect redirect - e.g. fill in a form, save it to session, then redirect to authentication and afterwards go back directly to next step, say, saving form data from session to database. |
storeRequest will be moved outside from Presenter. nette/application#4 |
I'd like to store the request in ErrorPresenter like this: