Re: [Cheetahtemplate-discuss] Comparison with Smarty Template Engine
Brought to you by:
rtyler,
tavis_rudd
From: <web...@ap...> - 2002-12-24 01:01:40
|
On 23 xii 2002 at 05:18:49 Mike Orr <ir...@se...> wrote: >> Smarty are modular. > What does that mean? How are Smarty modules different from Cheetah > #extends? No. Smarty are modular, but not in object sense. By modular I mean their plugin architecture that is used for almost all the customizable functionality of Smarty. This includes: functions, modifiers, block functions, compiler functions, prefilters, postfilters, outputfilters, resources and inserts. >> Config variables have also no equivalent in >> Cheetah. They are usefull if you want to prepare multilingual version >> of your code. > Can you give an example? Sure. This was taken from my application: file: config_en.txt: =================== [menu] title = "Internet Bible" [options] # used in search section: refonly_off = "show full text" refonly_on = "references only" polish_on = "with Polish characters" polish_off = "plain ASCII" bold_on = "bold" bold_off = "don't bold" bold_txt = "searched words" step_txt1 = "show every" step_txt2 = "verses" context_txt1 = "context" context_0 = "don't show" context_1 = "1 verse" context_2 = "2 verses" context_3 = "3 verses" context_4 = "4 verses" context_5 = "5 verses" ... file: config_pl.txt: =================== [menu] title = "Biblia Internetowa" [options] # used in search section: refonly_off = "pełne cytaty" refonly_on = "tylko odnośniki" polish_on = "z polskimi znakami" polish_off = "bez polskich znaków" bold_on = "podkreślaj" bold_off = "nie podkreślaj" bold_txt = "szukane słowa" step_txt1 = "porcjami co" step_txt2 = "wersetów" context_txt1 = "kontekst" context_0 = "nie pokazuj" context_1 = "1 wersetu" context_2 = "2 wersetów" context_3 = "3 wersetów" context_4 = "4 wersetów" context_5 = "5 wersetów" ... file: main.tpl ============== {strip} {config_load file="config_$language.txt" section="menu"} {include file="header.tpl" title=#title#} <h1> {#title#} {$version|default:1.0} ... </h1> ... {/strip} file: header.tpl ================ .... <title>{$title|default:Noname}</title> ... file: optionBold.tpl ==================== {strip} {config_load file="config_$language.txt" section="options"} <select id="bold" name="bold" onchange="submit();"> <option value="on">{#bold_on#}</option> <option value="off"{if $smarty.get.bold eq "off"} selected="selected"{/if}> {#bold_off#} </option> </select> {#bold_txt#} {/strip} >> In Smarty you can decide where your templates will be brought from. >> It is no necessery to use only system files. You can download all >> templates from database. And it can be transparent for syntax of >> Smarty templates. > This sounds like the same as Cheetah, if I understand right. I am just learning Cheetah so I do not know if it is the same. > What do these filters do that a separate program running in a > pipeline before or after Cheetah can't do? I am not sure. But I can see Smarty's syntax more clear with such pipelines. > What is HomeSite 5? An HTML editor? Yes. This is the best HTML editor for Windows. Macromedia bought it now and included some of its code into Dreamweaver MX. Another my favourite editor is XMLSpy (http://www.xmlspy.com). It can validate xhtml and xml files and transform them using fast XSLT library. I use XML and DocBook for preparing PDF and XHTML. BTW, why user guide is created with LaTeX? Why not in DocBook? DocBook is XML, it is easer to learn and can be transformed to any format you need. -- Jaroslaw Zabiello (UIN: 6712522) Home: http://www.pik-net.pl/zbiru |