Remove @ from layout template file name
- Honza Marek
- Member | 1664
I don't think there is any reason to have @ character in layout template file name. It just complicate stuff, so it should be removed.
BC break: No. Method formatLayoutTemplateFile can be changed backward compatible.
- Jan Tvrdík
- Nette guru | 2595
I don't think there is any reason to have @ character in layout template file name
Yes, there is. You can have a special @layout.latte
for a
specific presenter (app/templates/Sign/@layout.latte
). Removing the
@
would allow the template to be misused for action
layout
.
- David Grudl
- Nette Core | 8206
The @ character with this
exist as prevention against „URL attacks“ like
example.com?presenter=xxx&action=layout
. It can be removed if
you propose any different solution.
- Honza Marek
- Member | 1664
Other templates can be misused for actions too. I sometimes create partial templates right next to the action templates – menu.latte, someItemBox.latte, … I know I have to be careful with this. Maybe I should start partial template names with ugly @ sign too.
Ideal solution for me would be obligatory action/render methods for actions in presenters. Unfortunately it would break backward compatibility a lot.
- David Grudl
- Nette Core | 8206
Yes, you should prefix them (with any \W character) or move them to special folder.
- Milo
- Nette Core | 1283
Security reasons to preserve @
has been mentioned. If you
propose another solution, please, open new RFC with description. For your needs,
you can overload Presenter::formatLayoutTemplateFiles().