Differences between revisions 3 and 5 (spanning 2 versions)
Revision 3 as of 2009-02-24 14:12:47
Size: 644
Editor: 147
Comment:
Revision 5 as of 2009-02-24 14:15:11
Size: 641
Editor: 147
Comment:
Deletions are marked like this. Additions are marked like this.
Line 16: Line 16:
{{{attachment:hello.txt}}}
{{attachment:hello.html}}

Hello, world verzia 3

Mať HTML kód vo vnútri view nie je dobrý nápad. HTML by malo byť iba v šablónach, aby sme mali jedno miesto, kde je HTML a nemuseli teda pri zmene HTML zasahovať do kódu.

Teraz ideme upraviť Hello, world verziu 2 tak, aby sme použili Template.

Keďže vytvárať Template zo stringu odporuje zásade v prvom odstavci, šablóny budú v súboroch.

Vytvoríme v adresári projektu hello podadresár s názvom napr. templates. V podadresári templates vytvoríme šablónu hello.html:

hello.html

KMaDGWiki: ProgramovanieInternetovychAplikacii/HelloWorldV3 (last edited 2009-02-24 14:30:30 by 147)