How to check, if current request is render, action or handle

steelbull
Member | 240
+
-1
-

Hi, I would like to ask about how to check, if current request is a RENDER, ACTION or HANDLE.

Thx.

Ondřej Kubíček
Member | 494
+
+2
-

Do you know how it works? Every request run action, handle (if it is), render in this order. See https://doc.nette.org/…n/presenters#…

steelbull
Member | 240
+
0
-

@OndřejKubíček Thanks. I checked it and understand. But, I need a solve following situation:

I want remember the last presenter with action and parameters except those actions, which was an action or POST.
Its because I need it for remember previous path when user click to BACK button, for example in form. The user will be redirected to previous path (from which he opened the form – I don't want to use JavaScript).

But if inside the form download link (which is action method in presenter), I want to ignore it and do not remember (because when I click to the link, system will remember the path and next, when I click to the cancel, file will be downloaded again instead of live the form).

…or maybe you now better way, how to remember previous links :-)

Thx.

Last edited by steelbull (2018-06-12 15:41)

Kori
Member | 73
+
-1
-

Hi, check storeRequest() and restoreRequest() methods

storeRequest() will create “backlink” to actual server request. You can choose when the backlink should be created / stored a and you can use backlinks in templates or wherever you need.

Example: https://doc.nette.org/…tore-request