How to have presenter method without template
- kevin.waterson@gmail.com
- Member | 81
I have a simple delete function in a presenter.
This works fine, but it requires a matching template, named
deletecategory.latte.
I have created a blank template, and that works, but does not seem the right
way to do things.
How do I have this method, without the template?
- Kamil Valenta
- Member | 836
or
(second one is too bad practice)
Be careful:
- redirect in render method
- redirect in try block
Last edited by kamil_v (2020-01-05 14:24)
- Marek Bartoš
- Nette Blogger | 1298
For delete use form with single button, if you use nette 2.4 or lower.
For nette 3.0 use handle method, they have built-in CSRF protection
Btw. handle method is called after action, be careful
And try to not put redirect inside try-catch. Too often happened to me, that
redirect exception was catched
Last edited by Mabar (2020-01-05 23:51)