Content added Content deleted
imported>mutante mNo edit summary |
imported>mutante m (from took) |
||
Line 1: | Line 1: | ||
Smarty ist eine recht stark verbreitete und dadurch ziemlich ausgereifte [[open source]] [[template engine]]. |
Smarty ist eine recht stark verbreitete und dadurch ziemlich ausgereifte [[open source]] [[template engine]]. |
||
Man setzt im [[PHP]]-Quellcode nur noch Werte die der Designer dann später leicht nutzen kann. zb so: |
|||
$Smarty->assign("varnamefuertemplate", $phpvariable); (wobei $phpvariable auch zB ein array sein kann). im template (extra files, die auf .tpl enden und hauptsächlich reinen html-code enthalten) kann man dann zb schreiben: |
|||
"Hallo {$name}, du bist eingelogt" |
|||
oder listen machen mit:<pre><table><tr><td>nr</td><td>name</td></tr> {foreach item=foo from=$var</pre> |
|||
"One of Smartys primary design goals is to facilitate the separation of application code from presentation. Typically, the application code is maintained by programmers. The presentation templates are maintained by template designers." |
"One of Smartys primary design goals is to facilitate the separation of application code from presentation. Typically, the application code is maintained by programmers. The presentation templates are maintained by template designers." |
Revision as of 19:21, 24 October 2006
Smarty ist eine recht stark verbreitete und dadurch ziemlich ausgereifte open source template engine.
Man setzt im PHP-Quellcode nur noch Werte die der Designer dann später leicht nutzen kann. zb so:
$Smarty->assign("varnamefuertemplate", $phpvariable); (wobei $phpvariable auch zB ein array sein kann). im template (extra files, die auf .tpl enden und hauptsächlich reinen html-code enthalten) kann man dann zb schreiben:
"Hallo {$name}, du bist eingelogt"
oder listen machen mit:
<table><tr><td>nr</td><td>name</td></tr> {foreach item=foo from=$var
"One of Smartys primary design goals is to facilitate the separation of application code from presentation. Typically, the application code is maintained by programmers. The presentation templates are maintained by template designers."
Template loop detected: Template:Stub