Remove @ from layout template file name

Notice: This thread is very old.
Honza Marek
Member | 1664
+
0
-

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.

Majkl578
Moderator | 1364
+
0
-

It just complicate stuff, so it should be removed.

How?

Jan Tvrdík
Nette guru | 2595
+
0
-

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.

Patrik Votoček
Member | 2221
+
0
-

I agree with @Jan Tvrdík

Felix
Nette Core | 1183
+
0
-

I like a name @layout.latte, so agree with @Jantvrdik etc.

David Grudl
Nette Core | 8082
+
0
-

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
+
0
-

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 | 8082
+
0
-

Yes, you should prefix them (with any \W character) or move them to special folder.

Milo
Nette Core | 1283
+
0
-

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().