Site Tools


Hotfix release available: 2025-05-14b "Librarian". upgrade now! [56.2] (what's this?)
Hotfix release available: 2025-05-14a "Librarian". upgrade now! [56.1] (what's this?)
New release available: 2025-05-14 "Librarian". upgrade now! [56] (what's this?)
Hotfix release available: 2024-02-06b "Kaos". upgrade now! [55.2] (what's this?)
mydok:smarty

This is an old revision of the document!


Table of Contents

Konstanten

Konstanten werden in php definiert und können im Template verwendet werden.
php: define('platzzahl',12);
tpl: <br>Plaetze: {$smarty.const.platzzahl}<br>

Variable

Konstanten werden in php definiert und können im Template verwendet werden:
php: $smarty→assign('name', 'Hans');
tpL: <br>Name: {$name}<br>

Konfigdatei

  • wird im Verzeichnis configs angelegt
  • z.B. rv.conf:
    • # Kommentar: Konfigurationsdatei
    • platzzahl = 10
  • in *tpl-Datei (z.B. 1.Zeile):
    • {config_load file=“rv.conf”}
  • Variable in tpl dann verwenden:
    • <br>Plaetze: {$smarty.config.platzzahl}<br>
  • Variable in *php verwenden:
    • $conf = new Config_File($smarty→config_dir);
    • $platzzahl=$conf→get('rv.conf','menu','platzzahl'); wenn in rv.conf / Sektion menu definiert
    • $platzzahl=$conf→get('rv.conf',NULL,'platzzahl'); wenn global ohne Sektion in rv.conf definiert.
mydok/smarty.1227104186.txt.gz · Last modified: 2024/04/15 00:43 (external edit)