diff --git a/docs/en/appendixes/resources.xml b/docs/en/appendixes/resources.xml index 91917493..82ffc8f4 100644 --- a/docs/en/appendixes/resources.xml +++ b/docs/en/appendixes/resources.xml @@ -1,14 +1,14 @@ - - Resources - - Smarty's homepage is located at &url.smarty;. - You can join the mailing list by sending an e-mail to - &ml.general.sub;. An archive of the mailing list can - be viewed at &url.ml.archive;. - + + Resources + + Smarty's homepage is located at &url.smarty;. + You can join the mailing list by sending an e-mail to + &ml.general.sub;. An archive of the mailing list can + be viewed at &url.ml.archive;. + - - - - - -

-Welcome to WAP with Smarty! -Press OK to continue... -

-
- - -

-Pretty easy isn't it? -

-
+ + + + + +

+ Welcome to WAP with Smarty! + Press OK to continue... +

+
+ + +

+ Pretty easy isn't it? +

+
]]> @@ -307,10 +307,7 @@ function smarty_function_load_ticker($params, &$smarty) Example of Obfuscating an E-mail Address Smarty - the compiling PHP template engine - MonteOhrt <monte@ispi.net> + Monte + Ohrt <monte@ispi.net> - AndreiZmievski <andrei@php.net> + Andrei + Zmievski <andrei@php.net> &build-date; diff --git a/docs/en/designers/config-files.xml b/docs/en/designers/config-files.xml index c6897e9e..70ea7cc1 100644 --- a/docs/en/designers/config-files.xml +++ b/docs/en/designers/config-files.xml @@ -32,7 +32,7 @@ Intro = """This is a value that spans more # hidden section [.Database] -host=my.domain.com +host=my.example.com db=ADDRESSBOOK user=php-user pass=foobar diff --git a/docs/en/designers/language-builtin-functions/language-function-include.xml b/docs/en/designers/language-builtin-functions/language-function-include.xml index 4202fe86..9273990a 100644 --- a/docs/en/designers/language-builtin-functions/language-function-include.xml +++ b/docs/en/designers/language-builtin-functions/language-function-include.xml @@ -79,7 +79,7 @@ {* body of template goes here *} -{include file="footer.tpl" logo="http://my.domain.com/logo.gif"} +{include file="footer.tpl" logo="http://my.example.com/logo.gif"} Use the syntax for \ No newline at end of file +--> diff --git a/docs/en/designers/language-builtin-functions/language-function-section.xml b/docs/en/designers/language-builtin-functions/language-function-section.xml index 9c5d22d7..4924c1ee 100644 --- a/docs/en/designers/language-builtin-functions/language-function-section.xml +++ b/docs/en/designers/language-builtin-functions/language-function-section.xml @@ -174,21 +174,21 @@ name: John Smith<br> address: 253 N 45th<br> home phone: 555-555-5555<br> cell phone: 555-555-5555<br> -e-mail: john@mydomain.com<br> +e-mail: john@myexample.com<br> <p> id: 1001<br> name: Jack Jones<br> address: 417 Mulberry ln<br> home phone: 555-555-5555<br> cell phone: 555-555-5555<br> -e-mail: jack@mydomain.com<br> +e-mail: jack@myexample.com<br> <p> id: 1002<br> name: Jane Munson<br> address: 5605 apple st<br> home phone: 555-555-5555<br> cell phone: 555-555-5555<br> -e-mail: jane@mydomain.com<br> +e-mail: jane@myexample.com<br> <p> @@ -210,15 +210,15 @@ OUTPUT: name: John Smith<br> home: 555-555-5555<br> cell: 555-555-5555<br> -e-mail: john@mydomain.com<p> +e-mail: john@myexample.com<p> name: Jack Jones<br> home phone: 555-555-5555<br> cell phone: 555-555-5555<br> -e-mail: jack@mydomain.com<p> +e-mail: jack@myexample.com<p> name: Jane Munson<br> home phone: 555-555-5555<br> cell phone: 555-555-5555<br> -e-mail: jane@mydomain.com<p> +e-mail: jane@myexample.com<p> diff --git a/docs/en/designers/language-builtin-functions/language-function-strip.xml b/docs/en/designers/language-builtin-functions/language-function-strip.xml index 7b06206a..93ec5b11 100644 --- a/docs/en/designers/language-builtin-functions/language-function-strip.xml +++ b/docs/en/designers/language-builtin-functions/language-function-strip.xml @@ -44,7 +44,7 @@ OUTPUT: -
This is a test
+
This is a test
]]> diff --git a/docs/en/designers/language-custom-functions/language-function-fetch.xml b/docs/en/designers/language-custom-functions/language-function-fetch.xml index d4e5aa7d..3e288ba4 100644 --- a/docs/en/designers/language-custom-functions/language-function-fetch.xml +++ b/docs/en/designers/language-custom-functions/language-function-fetch.xml @@ -71,13 +71,13 @@ \ No newline at end of file +--> diff --git a/docs/en/designers/language-custom-functions/language-function-html-options.xml b/docs/en/designers/language-custom-functions/language-function-html-options.xml index e95e8471..8eb2528e 100644 --- a/docs/en/designers/language-custom-functions/language-function-html-options.xml +++ b/docs/en/designers/language-custom-functions/language-function-html-options.xml @@ -1,62 +1,62 @@ - - html_options - - - - - - - - - - Attribute Name - Type - Required - Default - Description - - - - - values - array - Yes, unless using options attribute - n/a - an array of values for dropdown - - - output - array - Yes, unless using options attribute - n/a - an array of output for dropdown - - - selected - string/array - No - empty - the selected option element(s) - - - options - associative array - Yes, unless using values and output - n/a - an associative array of values and output - - - name - string - No - empty - name of select group - - - - + + html_options + + + + + + + + + + Attribute Name + Type + Required + Default + Description + + + + + values + array + Yes, unless using options attribute + n/a + an array of values for dropdown + + + output + array + Yes, unless using options attribute + n/a + an array of output for dropdown + + + selected + string/array + No + empty + the selected option element(s) + + + options + associative array + Yes, unless using values and output + n/a + an associative array of values and output + + + name + string + No + empty + name of select group + + + + html_options is a custom function that creates html option group with provided data. It takes care of which item(s) are selected by @@ -146,4 +146,4 @@ End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 ---> \ No newline at end of file +--> diff --git a/docs/en/designers/language-custom-functions/language-function-mailto.xml b/docs/en/designers/language-custom-functions/language-function-mailto.xml index 3b576280..7ea52b48 100644 --- a/docs/en/designers/language-custom-functions/language-function-mailto.xml +++ b/docs/en/designers/language-custom-functions/language-function-mailto.xml @@ -1,134 +1,129 @@ - - mailto - - - - - - - - - - Attribute Name - Type - Required - Default - Description - - - - - address - string - Yes - n/a - the e-mail address - - - text - string - No - n/a - the text to display, default is - the e-mail address - - - encode - string - No - none - How to encode the e-mail. - Can be one of none, - hex or javascript. - - - cc - string - No - n/a - e-mail addresses to carbon copy. - Separate entries by a comma. - - - bcc - string - No - n/a - e-mail addresses to blind carbon copy. - Separate entries by a comma. - - - subject - string - No - n/a - e-mail subject. - - - newsgroups - string - No - n/a - newsgroups to post to. - Separate entries by a comma. - - - followupto - string - No - n/a - addresses to follow up to. - Separate entries by a comma. - - - extra - string - No - n/a - any extra information you - want passed to the link, such - as style sheet classes - - - - - - mailto automates the creation of mailto links and optionally - encodes them. Encoding e-mails makes it more difficult for - web spiders to pick up e-mail addresses off of your site. - - - Technical Note - - javascript is probably the most thorough form of - encoding, although you can use hex encoding too. - - - -mailto - -{mailto address="me@domain.com"} -{mailto address="me@domain.com" text="send me some mail"} -{mailto address="me@domain.com" encode="javascript"} -{mailto address="me@domain.com" encode="hex"} -{mailto address="me@domain.com" subject="Hello to you!"} -{mailto address="me@domain.com" cc="you@domain.com,they@domain.com"} -{mailto address="me@domain.com" extra='class="email"'} + + mailto + + + + + + + + + + Attribute Name + Type + Required + Default + Description + + + + + address + string + Yes + n/a + the e-mail address + + + text + string + No + n/a + the text to display, default is the e-mail address + + + encode + string + No + none + How to encode the e-mail. Can be one of none, + hex or javascript. + + + cc + string + No + n/a + e-mail addresses to carbon copy. Separate entries by a comma. + + + + bcc + string + No + n/a + e-mail addresses to blind carbon copy. + Separate entries by a comma. + + + subject + string + No + n/a + e-mail subject. + + + newsgroups + string + No + n/a + newsgroups to post to. Separate entries by a comma. + + + followupto + string + No + n/a + addresses to follow up to. Separate entries by a comma. + + + extra + string + No + n/a + any extra information you want passed to the link, such + as style sheet classes + + + + + + mailto automates the creation of mailto links and optionally + encodes them. Encoding e-mails makes it more difficult for + web spiders to pick up e-mail addresses off of your site. + + + Technical Note + + javascript is probably the most thorough form of + encoding, although you can use hex encoding too. + + + + mailto + +{mailto address="me@example.com"} +{mailto address="me@example.com" text="send me some mail"} +{mailto address="me@example.com" encode="javascript"} +{mailto address="me@example.com" encode="hex"} +{mailto address="me@example.com" subject="Hello to you!"} +{mailto address="me@example.com" cc="you@example.com,they@example.com"} +{mailto address="me@example.com" extra='class="email"'} OUTPUT: -<a href="mailto:me@domain.com" >me@domain.com</a> -<a href="mailto:me@domain.com" >send me some mail</a> +<a href="mailto:me@example.com" >me@example.com</a> +<a href="mailto:me@example.com" >send me some mail</a> <script type="text/javascript" language="javascript">eval(unescape('%64%6f%63%75%6d%65%6e%74%2e%77%72%6 9%74%65%28%27%3c%61%20%68%72%65%66%3d%22%6d%61%69%6c%74%6f%3a%6d%65%40%64%6f%6d% 61%69%6e%2e%63%6f%6d%22%20%3e%6d%65%40%64%6f%6d%61%69%6e%2e%63%6f%6d%3c%2f%61%3e %27%29%3b'))</script> <a href="mailto:%6d%65@%64%6f%6d%61%69%6e.%63%6f%6d" >me@domain.com</a> -<a href="mailto:me@domain.com?subject=Hello%20to%20you%21" >me@domain.com</a> -<a href="mailto:me@domain.com?cc=you@domain.com%2Cthey@domain.com" >me@domain.com</a> -<a href="mailto:me@domain.com" class="email">me@domain.com</a> +<a href="mailto:me@example.com?subject=Hello%20to%20you%21" >me@example.com</a> +<a href="mailto:me@example.com?cc=you@example.com%2Cthey@example.com" >me@example.com</a> +<a href="mailto:me@example.com" class="email">me@example.com</a> \ No newline at end of file +--> diff --git a/docs/en/designers/language-custom-functions/language-function-popup.xml b/docs/en/designers/language-custom-functions/language-function-popup.xml index c9ca86a7..9e36e457 100644 --- a/docs/en/designers/language-custom-functions/language-function-popup.xml +++ b/docs/en/designers/language-custom-functions/language-function-popup.xml @@ -1,411 +1,415 @@ - - popup - - - - - - - - - - Attribute Name - Type - Required - Default - Description - - - - - text - string - Yes - n/a - the text/html to display in the popup window - - - trigger - string - No - onMouseOver - What is used to trigger the popup window. Can be - one of onMouseOver or onClick - - - sticky - boolean - No - false - Makes the popup stick around until closed - - - caption - string - No - n/a - sets the caption to title - - - fgcolor - string - No - n/a - color of the inside of the popup box - - - bgcolor - string - No - n/a - color of the border of the popup box - - - textcolor - string - No - n/a - sets the color of the text inside the box - - - capcolor - string - No - n/a - sets color of the box's caption - - - closecolor - string - No - n/a - sets the color of the close text - - - textfont - string - No - n/a - sets the font to be used by the main text - - - captionfont - string - No - n/a - sets the font of the caption - - - closefont - string - No - n/a - sets the font for the "Close" text - - - textsize - string - No - n/a - sets the size of the main text's font - - - captionsize - string - No - n/a - sets the size of the caption's font - - - closesize - string - No - n/a - sets the size of the "Close" text's font - - - width - integer - No - n/a - sets the width of the box - - - height - integer - No - n/a - sets the height of the box - - - left - boolean - No - false - makes the popups go to the left of the mouse - - - right - boolean - No - false - makes the popups go to the right of the mouse - - - center - boolean - No - false - makes the popups go to the center of the mouse - - - above - boolean - No - false - makes the popups go above the mouse. NOTE: only - possible when height has been set - - - below - boolean - No - false - makes the popups go below the mouse - - - border - integer - No - n/a - makes the border of the popups thicker or thinner - - - offsetx - integer - No - n/a - how far away from the pointer the popup will show - up, horizontally - - - offsety - integer - No - n/a - how far away from the pointer the popup will show - up, vertically - - - fgbackground - url to image - No - n/a - defines a picture to use instead of color for the - inside of the popup. - - - bgbackground - url to image - No - n/a - defines a picture to use instead of color for the - border of the popup. NOTE: You will want to set bgcolor - to "" or the color will show as well. NOTE: When having - a Close link, Netscape will re-render the table cells, - making things look incorrect - - - closetext - string - No - n/a - sets the "Close" text to something else - - - noclose - boolean - No - n/a - does not display the "Close" text on stickies - with a caption - - - status - string - No - n/a - sets the text in the browsers status bar - - - autostatus - boolean - No - n/a - sets the status bar's text to the popup's text. - NOTE: overrides status setting - - - autostatuscap - string - No - n/a - sets the status bar's text to the caption's text. - NOTE: overrides status and autostatus settings - - - inarray - integer - No - n/a - tells overLib to read text from this index in - the ol_text array, located in overlib.js. This - parameter can be used instead of text - - - caparray - integer - No - n/a - tells overLib to read the caption from this index - in the ol_caps array - - - capicon - url - No - n/a - displays the image given before the popup caption - - - snapx - integer - No - n/a - snaps the popup to an even position in a - horizontal grid - - - snapy - integer - No - n/a - snaps the popup to an even position in a - vertical grid - - - fixx - integer - No - n/a - locks the popups horizontal position Note: - overrides all other horizontal placement - - - fixy - integer - No - n/a - locks the popups vertical position Note: - overrides all other vertical placement - - - background - url - No - n/a - sets image to be used instead of table box - background - - - padx - integer,integer - No - n/a - pads the background image with horizontal - whitespace for text placement. Note: this is a two - parameter command - - - pady - integer,integer - No - n/a - pads the background image with vertical - whitespace for text placement. Note: this is a two - parameter command - - - fullhtml - boolean - No - n/a - allows you to control the html over a background - picture completely. The html code is expected in the "text" - attribute - - - frame - string - No - n/a - controls popups in a different frame. See the - overlib page for more info on this function - - - timeout - string - No - n/a - calls the specified javascript function and takes - the return value as the text that should be displayed in - the popup window - - - delay - integer - No - n/a - makes that popup behave like a tooltip. It will - popup only after this delay in milliseconds - - - hauto - boolean - No - n/a - automatically determine if the popup should be to - the left or right of the mouse. - - - vauto - boolean - No - n/a - automatically determine if the popup should be - above or below the mouse. - - - - - - popup is used to create javascript popup windows. - - -popup - + + popup + + + + + + + + + + Attribute Name + Type + Required + Default + Description + + + + + text + string + Yes + n/a + the text/html to display in the popup window + + + trigger + string + No + onMouseOver + What is used to trigger the popup window. Can be + one of onMouseOver or onClick + + + sticky + boolean + No + false + Makes the popup stick around until closed + + + caption + string + No + n/a + sets the caption to title + + + fgcolor + string + No + n/a + color of the inside of the popup box + + + bgcolor + string + No + n/a + color of the border of the popup box + + + textcolor + string + No + n/a + sets the color of the text inside the box + + + capcolor + string + No + n/a + sets color of the box's caption + + + closecolor + string + No + n/a + sets the color of the close text + + + textfont + string + No + n/a + sets the font to be used by the main text + + + captionfont + string + No + n/a + sets the font of the caption + + + closefont + string + No + n/a + sets the font for the "Close" text + + + textsize + string + No + n/a + sets the size of the main text's font + + + captionsize + string + No + n/a + sets the size of the caption's font + + + closesize + string + No + n/a + sets the size of the "Close" text's font + + + width + integer + No + n/a + sets the width of the box + + + height + integer + No + n/a + sets the height of the box + + + left + boolean + No + false + makes the popups go to the left of the mouse + + + right + boolean + No + false + makes the popups go to the right of the mouse + + + center + boolean + No + false + makes the popups go to the center of the mouse + + + above + boolean + No + false + makes the popups go above the mouse. NOTE: only + possible when height has been set + + + below + boolean + No + false + makes the popups go below the mouse + + + border + integer + No + n/a + makes the border of the popups thicker or thinner + + + offsetx + integer + No + n/a + how far away from the pointer the popup will show + up, horizontally + + + offsety + integer + No + n/a + how far away from the pointer the popup will show + up, vertically + + + fgbackground + url to image + No + n/a + defines a picture to use instead of color for the + inside of the popup. + + + bgbackground + url to image + No + n/a + defines a picture to use instead of color for the + border of the popup. NOTE: You will want to set bgcolor + to "" or the color will show as well. NOTE: When having + a Close link, Netscape will re-render the table cells, + making things look incorrect + + + closetext + string + No + n/a + sets the "Close" text to something else + + + noclose + boolean + No + n/a + does not display the "Close" text on stickies + with a caption + + + status + string + No + n/a + sets the text in the browsers status bar + + + autostatus + boolean + No + n/a + sets the status bar's text to the popup's text. + NOTE: overrides status setting + + + autostatuscap + string + No + n/a + sets the status bar's text to the caption's text. + NOTE: overrides status and autostatus settings + + + inarray + integer + No + n/a + tells overLib to read text from this index in + the ol_text array, located in overlib.js. This + parameter can be used instead of text + + + caparray + integer + No + n/a + tells overLib to read the caption from this index + in the ol_caps array + + + capicon + url + No + n/a + displays the image given before the popup caption + + + snapx + integer + No + n/a + snaps the popup to an even position in a + horizontal grid + + + snapy + integer + No + n/a + snaps the popup to an even position in a + vertical grid + + + fixx + integer + No + n/a + locks the popups horizontal position Note: + overrides all other horizontal placement + + + fixy + integer + No + n/a + locks the popups vertical position Note: + overrides all other vertical placement + + + background + url + No + n/a + sets image to be used instead of table box + background + + + padx + integer,integer + No + n/a + pads the background image with horizontal + whitespace for text placement. Note: this is a two + parameter command + + + pady + integer,integer + No + n/a + pads the background image with vertical + whitespace for text placement. Note: this is a two + parameter command + + + fullhtml + boolean + No + n/a + allows you to control the html over a background + picture completely. The html code is expected in the "text" + attribute + + + frame + string + No + n/a + controls popups in a different frame. See the + overlib page for more info on this function + + + timeout + string + No + n/a + calls the specified javascript function and takes + the return value as the text that should be displayed in + the popup window + + + delay + integer + No + n/a + makes that popup behave like a tooltip. It will + popup only after this delay in milliseconds + + + hauto + boolean + No + n/a + automatically determine if the popup should be to + the left or right of the mouse. + + + vauto + boolean + No + n/a + automatically determine if the popup should be + above or below the mouse. + + + + + + popup is used to create javascript popup windows. + + + popup + +mypage {* you can use html, links, etc in your popup text *} -<A href="mypage.html" {popup sticky=true caption="mypage contents" -text="<UL><LI>links<LI>pages<LI>images</UL>" snapx=10 snapy=10}>mypage</A> - +mypage +]]> + + - - Objects - - Smarty allows access to PHP objects through the templates. There are + + Objects + + Smarty allows access to PHP objects through the templates. There are two ways to access them. One way is to register objects to the template, then use access them via syntax similar to custom functions. The other way is to assign objects to the templates and access them much like any other @@ -13,41 +13,41 @@ or assigned in arrays of objects, etc. The method you choose will be determined by your needs, but use the first method whenever possible to keep template syntax to a minimum. - + - If security is enabled, no private methods or functions can be accessed - (begininning with "_"). If a method and property of the same name exist, - the method will be used. + If security is enabled, no private methods or functions can be accessed + (begininning with "_"). If a method and property of the same name exist, + the method will be used. - You can restrict the methods and properties that can be accessed by - listing them in an array as the third registration parameter. + You can restrict the methods and properties that can be accessed by + listing them in an array as the third registration parameter. - By default, parameters passed to objects through the templates are passed - the same way custom functions get them. An associative array is passed - as the first parameter, and the smarty object as the second. If you want - the parameters passed one at a time for each argument like traditional - object parameter passing, set the fourth registration parameter to false. + By default, parameters passed to objects through the templates are passed + the same way custom functions get them. An associative array is passed + as the first parameter, and the smarty object as the second. If you want + the parameters passed one at a time for each argument like traditional + object parameter passing, set the fourth registration parameter to false. - The optional fifth parameter has only effect with - format being true - and contains a list ob methods that should be treated as - blocks. That means these methods have a closing tag in the - template - ({foobar->meth2}...{/foobar->meth2}) and - the parameters to the methods have the same synopsis as the - parameters for block-function-plugins: They get 4 parameters - $params, - $content, - &$smarty and - &$repeat and they also behave like - block-function-plugins. + The optional fifth parameter has only effect with + format being true + and contains a list ob methods that should be treated as + blocks. That means these methods have a closing tag in the + template + ({foobar->meth2}...{/foobar->meth2}) and + the parameters to the methods have the same synopsis as the + parameters for block-function-plugins: They get 4 parameters + $params, + $content, + &$smarty and + &$repeat and they also behave like + block-function-plugins. - - using a registered or assigned object - + + using a registered or assigned object + assign_by_ref("myobj", $myobj); $smarty->display("index.tpl"); ?> - -TEMPLATE: - +]]> + + + And here's how to access your objects in index.tpl: + + +meth1 p1="foo" p2=$bar} @@ -84,8 +88,8 @@ the output was {$output} {* access our assigned object *} {$myobj->meth1("foo",$bar)} ]]> - - + + \ No newline at end of file +--> diff --git a/docs/en/programmers/advanced-features/advanced-features-outputfilters.xml b/docs/en/programmers/advanced-features/advanced-features-outputfilters.xml index 6f77c7e9..cc55a479 100644 --- a/docs/en/programmers/advanced-features/advanced-features-outputfilters.xml +++ b/docs/en/programmers/advanced-features/advanced-features-outputfilters.xml @@ -42,7 +42,7 @@ $smarty->display("index.tpl"); // a simple protection against spambots ?> ]]> - + \ No newline at end of file +--> diff --git a/docs/en/programmers/advanced-features/advanced-features-postfilters.xml b/docs/en/programmers/advanced-features/advanced-features-postfilters.xml index 606b0656..2992f8f3 100644 --- a/docs/en/programmers/advanced-features/advanced-features-postfilters.xml +++ b/docs/en/programmers/advanced-features/advanced-features-postfilters.xml @@ -1,22 +1,22 @@ - - Postfilters - - Template postfilters are PHP functions that your templates are ran through - after they are compiled. Postfilters can be either - registered or loaded - from the plugins directory by using - load_filter() function or by - setting - $autoload_filters - variable. Smarty will pass the compiled template code as the first - argument, and expect the function to return the result of the - processing. - - - using a template postfilter - + + Postfilters + + Template postfilters are PHP functions that your templates are ran through + after they are compiled. Postfilters can be either + registered or loaded + from the plugins directory by using + load_filter() function or by + setting + $autoload_filters + variable. Smarty will pass the compiled template code as the first + argument, and expect the function to return the result of the + processing. + + + using a template postfilter + register_postfilter("add_header_comment"); $smarty->display("index.tpl"); ?> - -{* compiled Smarty template index.tpl *} +]]> + + + This will make the compiled Smarty template index.tpl look like: + + + {* rest of template content... *} ]]> - - + + \ No newline at end of file +--> diff --git a/docs/en/programmers/advanced-features/advanced-features-prefilters.xml b/docs/en/programmers/advanced-features/advanced-features-prefilters.xml index c006ef2b..943965bb 100644 --- a/docs/en/programmers/advanced-features/advanced-features-prefilters.xml +++ b/docs/en/programmers/advanced-features/advanced-features-prefilters.xml @@ -1,23 +1,28 @@ - - Prefilters - - Template prefilters are PHP functions that your templates are ran through - before they are compiled. This is good for preprocessing your templates - to remove unwanted comments, keeping an eye on what people are putting - in their templates, etc. Prefilters can be either - registered or loaded from - the plugins directory by using - load_filter() function or by - setting - $autoload_filters variable. - Smarty will pass the template source code as the first argument, and - expect the function to return the resulting template source code. - - - using a template prefilter - + + Prefilters + + Template prefilters are PHP functions that your templates are ran through + before they are compiled. This is good for preprocessing your templates + to remove unwanted comments, keeping an eye on what people are putting + in their templates, etc. + + + Prefilters can be either registered or loaded from + the plugins directory by using load_filter() function or by setting + the $autoload_filters + variable. + + + Smarty will pass the template source code as the first argument, and + expect the function to return the resulting template source code. + + + using a template prefilter + register_prefilter("remove_dw_comments"); $smarty->display("index.tpl"); ?> - -{* Smarty template index.tpl *} - ]]> - - + + + This will remove all the comments in the template source. + + \ No newline at end of file +--> diff --git a/docs/en/programmers/advanced-features/template-resources.xml b/docs/en/programmers/advanced-features/template-resources.xml index 2d9bee6c..59ff40fa 100644 --- a/docs/en/programmers/advanced-features/template-resources.xml +++ b/docs/en/programmers/advanced-features/template-resources.xml @@ -3,12 +3,12 @@ Resources - The templates may come from a variety of sources. When you display or fetch - a template, or when you include a template from within another template, - you supply a resource type, followed by the appropriate path and template - name. If a resource is not explicitly given the value of $default_resource_type is - assumed. + The templates may come from a variety of sources. When you display or fetch + a template, or when you include a template from within another template, + you supply a resource type, followed by the appropriate path and template + name. If a resource is not explicitly given the value of $default_resource_type is + assumed. Templates from $template_dir @@ -228,4 +228,4 @@ End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 ---> \ No newline at end of file +-->