Uživatelské nástroje

Nástroje pro tento web


twig

Rozdíly

Zde můžete vidět rozdíly mezi vybranou verzí a aktuální verzí dané stránky.

Odkaz na výstup diff

Obě strany předchozí revizePředchozí verze
Následující verze
Předchozí verze
twig [2013/09/30 13:13] – [Twig] blazektwig [2023/12/26 19:13] (aktuální) – upraveno mimo DokuWiki 127.0.0.1
Řádek 52: Řádek 52:
 **Demo example page:** http://twig.isn.cz/first.php **Demo example page:** http://twig.isn.cz/first.php
  
-<file html "templates/base.html">+<file html "templates/base.twig">
 <!DOCTYPE html> <!DOCTYPE html>
 <html> <html>
     <head>     <head>
 +        {% block htmlHead %}
         <title>         <title>
             {% block titleHead %}             {% block titleHead %}
Řádek 62: Řádek 63:
         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
         <link rel="stylesheet" href="./css/style.css" />         <link rel="stylesheet" href="./css/style.css" />
-        {% block htmlHead %} 
         {% endblock %}         {% endblock %}
     </head>     </head>
Řádek 79: Řádek 79:
 </file> </file>
  
-<file html "templates/first.html">+<file html "templates/first.twig">
 {% extends "base.html" %} {% extends "base.html" %}
- 
 {# comment: include meta tags into block htmlHead #}  {# comment: include meta tags into block htmlHead #} 
 {% block htmlHead %} {% block htmlHead %}
 +{# comment: include content of htmlHead block of parent #}
 +{{ parent() }}
 <meta name="author" content="Jiří Blažek <jiri.blazek@isn.cz>" /> <meta name="author" content="Jiří Blažek <jiri.blazek@isn.cz>" />
 <meta name="Keywords" content="twig" /> <meta name="Keywords" content="twig" />
Řádek 95: Řádek 96:
  
 {% block content %} {% block content %}
-<a href='index.php'>&larr; Back to Demo Examples list of Twig</a>+<a href="index.php">&larr; Back to Demo Examples list of Twig</a>
  
-<br /><br /><strong>Url doc: </strong><a href='{{ firstPageDocUrl }}'>{{ firstPageDocUrl }}</a>+<br /><br /><strong>Url doc: </strong><a href="{{ firstPageDocUrl }}">{{ firstPageDocUrl }}</a>
  
 <br /><br />This is example text in content div. <br /><br />This is example text in content div.
Řádek 134: Řádek 135:
  
 // load template first.html // load template first.html
-$template = $twig->loadTemplate('first.html');+$template = $twig->loadTemplate('first.twig');
  
 // render page with this variables // render page with this variables
Řádek 159: Řádek 160:
 } }
 </file> </file>
- 
  
twig.1380539632.txt.bz2 · Poslední úprava: 2023/12/26 19:13 (upraveno mimo DokuWiki)