Skip to content

Commit 7152840

Browse files
committed
presenter: info about AbortException
1 parent b3288a0 commit 7152840

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

application/cs/presenters.texy

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ Kdykoliv během životního cyklu můžeme některou z následujících metod od
122122
- `sendResponse($response)` presenter ukončí a odešle [vlastní odpověď |#Odpovědi]
123123
- `terminate()` presenter ukončí bez odpovědi
124124

125+
Každá z těchto metod okamžitě ukončí činnost presenteru vyhozením tzv. tiché ukončovací výjimky `Nette\Application\AbortException`.
126+
125127
Pokud žádnou z těchto metod nezavoláte, presenter automaticky přistoupí k vykreslí šablony. Proč? Protože v 99 % případů chceme vykreslit šablonu, tudíž presenter tohle chování bere jako výchozí a chce nám ulehčit práci.
126128

127129

application/en/presenters.texy

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ At any point during the life cycle, we can use one of the following methods to s
122122
- `sendResponse($response)` terminates the presenter and sends a [custom response |#Responses]
123123
- `terminate()` terminates the presenter without a response
124124

125+
Each of these methods immediately terminates the presenter by throwing a silent termination exception `Nette\Application\AbortException`.
126+
125127
If you don't call any of these methods, the presenter automatically proceeds to render the template. Why? Because in 99% of cases, we want to render a template, so the presenter adopts this behavior as the default to simplify our work.
126128

127129

0 commit comments

Comments
 (0)