` tag (arrays are cycled)
- td\_attr string No *empty* Attributes for `` tag (arrays are cycled)
- trailpad string No * * Value to pad the trailing cells on last row with (if any)
- hdir string No *right* Direction of each row to be rendered. possible values: *right* (left-to-right), and *left* (right-to-left)
- vdir string No *down* Direction of each column to be rendered. possible values: *down* (top-to-bottom), *up* (bottom-to-top)
+## Attributes
+
+| Attribute Name | Required | Description |
+|----------------|----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| loop | Yes | Array of data to loop through |
+| cols | No | Number of columns in the table or a comma-separated list of column heading names or an array of column heading names.if the cols-attribute is empty, but rows are given, then the number of cols is computed by the number of rows and the number of elements to display to be just enough cols to display all elements. If both, rows and cols, are omitted cols defaults to 3. if given as a list or array, the number of columns is computed from the number of elements in the list or array. |
+| rows | No | Number of rows in the table. if the rows-attribute is empty, but cols are given, then the number of rows is computed by the number of cols and the number of elements to display to be just enough rows to display all elements. |
+| inner | No | Direction of consecutive elements in the loop-array to be rendered. *cols* means elements are displayed col-by-col. *rows* means elements are displayed row-by-row. |
+| caption | No | Text to be used for the `` element of the table |
+| table\_attr | No | Attributes for `` tag (defaults to 'border="1"') |
+| th\_attr | No | Attributes for `` tag (arrays are cycled) |
+| tr\_attr | No | attributes for ` | ` tag (arrays are cycled) |
+| td\_attr | No | Attributes for `` tag (arrays are cycled) |
+| trailpad | No | Value to pad the trailing cells on last row with (if any) (defaults to ' ') |
+| hdir | No | Direction of each row to be rendered. possible values: *right* (left-to-right), and *left* (right-to-left) (defaults to 'right') |
+| vdir | No | Direction of each column to be rendered. possible values: *down* (top-to-bottom), *up* (bottom-to-top) (defaults to 'down') |
- The `cols` attribute determines how many columns will be in the
table.
@@ -30,60 +31,63 @@ dumps an array of data into an HTML ``.
- `trailpad` is the value put into the trailing cells on the last
table row if there are any present.
-
+## Examples
-
- assign( 'data', array(1,2,3,4,5,6,7,8,9) );
- $smarty->assign( 'tr', array('bgcolor="#eeeeee"','bgcolor="#dddddd"') );
- $smarty->display('index.tpl');
- ?>
-
-
+```php
+assign( 'data', array(1,2,3,4,5,6,7,8,9) );
+$smarty->assign( 'tr', array('bgcolor="#eeeeee"','bgcolor="#dddddd"') );
+$smarty->display('index.tpl');
+```
The variables assigned from php could be displayed as these three
examples demonstrate. Each example shows the template followed by
output.
-
- {**** Example One ****}
- {html_table loop=$data}
-
-
+** Example 1 **
+```smarty
+{html_table loop=$data}
+```
+```html
+
- 1 | 2 | 3 |
- 4 | 5 | 6 |
- 7 | 8 | 9 |
+ 1 | 2 | 3 |
+ 4 | 5 | 6 |
+ 7 | 8 | 9 |
-
+
+```
-
- {**** Example Two ****}
- {html_table loop=$data cols=4 table_attr='border="0"'}
-
-
+** Example 2 **
+```smarty
+{html_table loop=$data cols=4 table_attr='border="0"'}
+```
+```html
+
- 1 | 2 | 3 | 4 |
- 5 | 6 | 7 | 8 |
- 9 | | | |
+ 1 | 2 | 3 | 4 |
+ 5 | 6 | 7 | 8 |
+ 9 | | | |
-
+
+```
-
- {**** Example Three ****}
- {html_table loop=$data cols="first,second,third,fourth" tr_attr=$tr}
-
-
+** Example 3 **
+```smarty
+{html_table loop=$data cols="first,second,third,fourth" tr_attr=$tr}
+```
+```html
+
-
- first | second | third | fourth |
-
+
+ first | second | third | fourth |
+
- 1 | 2 | 3 | 4 |
- 5 | 6 | 7 | 8 |
- 9 | | | |
+ 1 | 2 | 3 | 4 |
+ 5 | 6 | 7 | 8 |
+ 9 | | | |
-
-
+
+```
diff --git a/docs/designers/language-custom-functions/language-function-mailto.md b/docs/designers/language-custom-functions/language-function-mailto.md
index b90b725e..c32c2387 100644
--- a/docs/designers/language-custom-functions/language-function-mailto.md
+++ b/docs/designers/language-custom-functions/language-function-mailto.md
@@ -1,56 +1,61 @@
-{mailto} {#language.function.mailto}
-========
+# {mailto}
`{mailto}` automates the creation of a `mailto:` anchor links and
optionally encodes them. Encoding emails makes it more difficult for web
spiders to lift email addresses off of a site.
+## Attributes
+
+| Attribute Name | Required | Description |
+|----------------|----------|-----------------------------------------------------------------------------------------------|
+| address | Yes | The e-mail address |
+| text | No | The text to display, default is the e-mail address |
+| encode | No | How to encode the e-mail. Can be one of `none`, `hex`, `javascript` or `javascript_charcode`. |
+| cc | No | Email addresses to carbon copy, separate entries by a comma. |
+| bcc | No | Email addresses to blind carbon copy, separate entries by a comma |
+| subject | No | Email subject |
+| newsgroups | No | Newsgroups to post to, separate entries by a comma. |
+| followupto | No | Addresses to follow up to, separate entries by a comma. |
+| extra | No | Any extra information you want passed to the link, such as style sheet classes |
+
> **Note**
>
> Javascript is probably the most thorough form of encoding, although
> you can use hex encoding too.
- 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`, `javascript` or `javascript_charcode`.
- cc string No *n/a* Email addresses to carbon copy, separate entries by a comma.
- bcc string No *n/a* Email addresses to blind carbon copy, separate entries by a comma
- subject string No *n/a* Email 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
+## Examples
- {mailto address="me@example.com"}
- me@example.com
+```smarty
+{mailto address="me@example.com"}
+me@example.com
- {mailto address="me@example.com" text="send me some mail"}
- send me some mail
+{mailto address="me@example.com" text="send me some mail"}
+send me some mail
- {mailto address="me@example.com" encode="javascript"}
+{mailto address="me@example.com" encode="javascript"}
+ eval(unescape('%64%6f% ... snipped ...%61%3e%27%29%3b'))
+
- {mailto address="me@example.com" encode="hex"}
- m&..snipped...#x6f;m
+{mailto address="me@example.com" encode="hex"}
+m&..snipped...#x6f;m
- {mailto address="me@example.com" subject="Hello to you!"}
- me@example.com
+{mailto address="me@example.com" subject="Hello to you!"}
+me@example.com
- {mailto address="me@example.com" cc="you@example.com,they@example.com"}
- me@example.com
+{mailto address="me@example.com" cc="you@example.com,they@example.com"}
+me@example.com
- {mailto address="me@example.com" extra='class="email"'}
- me@example.com
+{mailto address="me@example.com" extra='class="email"'}
+me@example.com
- {mailto address="me@example.com" encode="javascript_charcode"}
+{mailto address="me@example.com" encode="javascript_charcode"}
+ {document.write(String.fromCharCode(60,97, ... snipped ....60,47,97,62))}
+
+```
-See also [`escape`](#language.modifier.escape),
-[`{textformat}`](#language.function.textformat) and [obfuscating email
-addresses](#tips.obfuscating.email).
+See also [`escape`](../language-modifiers/language-modifier-escape.md),
+[`{textformat}`](../language-custom-functions/language-function-textformat.md) and [obfuscating email
+addresses](../../appendixes/tips.md#obfuscating-e-mail-addresses).
diff --git a/docs/designers/language-custom-functions/language-function-math.md b/docs/designers/language-custom-functions/language-function-math.md
index 8a279620..7b34fccf 100644
--- a/docs/designers/language-custom-functions/language-function-math.md
+++ b/docs/designers/language-custom-functions/language-function-math.md
@@ -1,9 +1,18 @@
-{math} {#language.function.math}
-======
+# {math}
`{math}` allows the template designer to do math equations in the
template.
+## Attributes
+
+| Attribute Name | Required | Description |
+|----------------|----------|--------------------------------------------------|
+| equation | Yes | The equation to execute |
+| format | No | The format of the result (sprintf) |
+| var | Yes | Equation variable value |
+| assign | No | Template variable the output will be assigned to |
+| \[var \...\] | Yes | Equation variable value |
+
- Any numeric template variables may be used in the equations, and the
result is printed in place of the tag.
@@ -24,81 +33,67 @@ template.
> `{math}` is an expensive function in performance due to its use of the
> php [`eval()`](https://www.php.net/eval) function. Doing the math in PHP
> is much more efficient, so whenever possible do the math calculations
-> in the script and [`assign()`](#api.assign) the results to the
+> in the script and [`assign()`](../../programmers/api-functions/api-assign.md) the results to the
> template. Definitely avoid repetitive `{math}` function calls, eg
-> within [`{section}`](#language.function.section) loops.
+> within [`{section}`](../language-builtin-functions/language-function-section.md) loops.
- Attribute Name Type Required Default Description
- ---------------- --------- ---------- --------- --------------------------------------------------
- equation string Yes *n/a* The equation to execute
- format string No *n/a* The format of the result (sprintf)
- var numeric Yes *n/a* Equation variable value
- assign string No *n/a* Template variable the output will be assigned to
- \[var \...\] numeric Yes *n/a* Equation variable value
+## Examples
-**Example a:**
+**Example 1**
+```smarty
+{* $height=4, $width=5 *}
- {* $height=4, $width=5 *}
-
- {math equation="x + y" x=$height y=$width}
-
+{math equation="x + y" x=$height y=$width}
+```
+The above example will output:
+
+```
+9
+```
+
+
+**Example 2**
+
+```smarty
+{* $row_height = 10, $row_width = 20, #col_div# = 2, assigned in template *}
+
+{math equation="height * width / division"
+ height=$row_height
+ width=$row_width
+ division=#col_div#}
+```
The above example will output:
-
- 9
-
+```
+100
+```
+**Example 3**
-**Example b:**
+```smarty
+{* you can use parenthesis *}
-
- {* $row_height = 10, $row_width = 20, #col_div# = 2, assigned in template *}
-
- {math equation="height * width / division"
- height=$row_height
- width=$row_width
- division=#col_div#}
-
-
+{math equation="(( x + y ) / z )" x=2 y=10 z=2}
+```
The above example will output:
+```
+6
+```
- 100
+**Example 4**
+```smarty
+{* you can supply a format parameter in sprintf format *}
+
+{math equation="x + y" x=4.4444 y=5.0000 format="%.2f"}
+```
-
-**Example c:**
-
-
- {* you can use parenthesis *}
-
- {math equation="(( x + y ) / z )" x=2 y=10 z=2}
-
-
-
The above example will output:
-
-
- 6
-
-
-
-**Example d:**
-
-
- {* you can supply a format parameter in sprintf format *}
-
- {math equation="x + y" x=4.4444 y=5.0000 format="%.2f"}
-
-
-
-The above example will output:
-
-
- 9.44
-
-
+```
+9.44
+```
diff --git a/docs/designers/language-custom-functions/language-function-textformat.md b/docs/designers/language-custom-functions/language-function-textformat.md
index d0cd4cfc..4089fdb3 100644
--- a/docs/designers/language-custom-functions/language-function-textformat.md
+++ b/docs/designers/language-custom-functions/language-function-textformat.md
@@ -1,190 +1,182 @@
-{textformat} {#language.function.textformat}
-============
+# {textformat}
-`{textformat}` is a [block function](#plugins.block.functions) used to
+`{textformat}` is a [block function](../../programmers/plugins/plugins-block-functions.md) used to
format text. It basically cleans up spaces and special characters, and
formats paragraphs by wrapping at a boundary and indenting lines.
-You can set the parameters explicitly, or use a preset style. Currently
+You can set the parameters explicitly, or use a preset style. Currently,
"email" is the only available style.
- Attribute Name Type Required Default Description
- ---------------- --------- ---------- ------------------ ----------------------------------------------------------------------------------------
- style string No *n/a* Preset style
- indent number No *0* The number of chars to indent every line
- indent\_first number No *0* The number of chars to indent the first line
- indent\_char string No *(single space)* The character (or string of chars) to indent with
- wrap number No *80* How many characters to wrap each line to
- wrap\_char string No *\\n* The character (or string of chars) to break each line with
- wrap\_cut boolean No *FALSE* If TRUE, wrap will break the line at the exact character instead of at a word boundary
- assign string No *n/a* The template variable the output will be assigned to
+## Attributes
+
+| Attribute Name | Default | Description |
+|----------------|------------------|----------------------------------------------------------------------------------------|
+| style | *n/a* | Preset style |
+| indent | *0* | The number of chars to indent every line |
+| indent\_first | *0* | The number of chars to indent the first line |
+| indent\_char | *(single space)* | The character (or string of chars) to indent with |
+| wrap | *80* | How many characters to wrap each line to |
+| wrap\_char | *\\n* | The character (or string of chars) to break each line with |
+| wrap\_cut | *FALSE* | If TRUE, wrap will break the line at the exact character instead of at a word boundary |
+| assign | *n/a* | The template variable the output will be assigned to |
+
+## Examples
+
+```smarty
+{textformat wrap=40}
+
+This is foo.
+This is foo.
+This is foo.
+This is foo.
+This is foo.
+This is foo.
+
+This is bar.
+
+bar foo bar foo foo.
+bar foo bar foo foo.
+bar foo bar foo foo.
+bar foo bar foo foo.
+bar foo bar foo foo.
+bar foo bar foo foo.
+bar foo bar foo foo.
+
+{/textformat}
+```
+
+The above example will output:
+
+```
+This is foo. This is foo. This is foo.
+This is foo. This is foo. This is foo.
+
+This is bar.
+
+bar foo bar foo foo. bar foo bar foo
+foo. bar foo bar foo foo. bar foo bar
+foo foo. bar foo bar foo foo. bar foo
+bar foo foo. bar foo bar foo foo.
+```
+
+```smarty
+{textformat wrap=40 indent=4}
+
+This is foo.
+This is foo.
+This is foo.
+This is foo.
+This is foo.
+This is foo.
+
+This is bar.
+
+bar foo bar foo foo.
+bar foo bar foo foo.
+bar foo bar foo foo.
+bar foo bar foo foo.
+bar foo bar foo foo.
+bar foo bar foo foo.
+bar foo bar foo foo.
+
+{/textformat}
+```
+
+The above example will output:
+
+```
+ This is foo. This is foo. This is
+ foo. This is foo. This is foo. This
+ is foo.
+
+ This is bar.
+
+ bar foo bar foo foo. bar foo bar foo
+ foo. bar foo bar foo foo. bar foo
+ bar foo foo. bar foo bar foo foo.
+ bar foo bar foo foo. bar foo bar
+ foo foo.
+```
- {textformat wrap=40}
+```smarty
+{textformat wrap=40 indent=4 indent_first=4}
- This is foo.
- This is foo.
- This is foo.
- This is foo.
- This is foo.
- This is foo.
+This is foo.
+This is foo.
+This is foo.
+This is foo.
+This is foo.
+This is foo.
- This is bar.
+This is bar.
- bar foo bar foo foo.
- bar foo bar foo foo.
- bar foo bar foo foo.
- bar foo bar foo foo.
- bar foo bar foo foo.
- bar foo bar foo foo.
- bar foo bar foo foo.
+bar foo bar foo foo.
+bar foo bar foo foo.
+bar foo bar foo foo.
+bar foo bar foo foo.
+bar foo bar foo foo.
+bar foo bar foo foo.
+bar foo bar foo foo.
- {/textformat}
-
-
-
+{/textformat}
+```
The above example will output:
+```
+ This is foo. This is foo. This
+ is foo. This is foo. This is foo.
+ This is foo.
- This is foo. This is foo. This is foo.
- This is foo. This is foo. This is foo.
-
- This is bar.
-
- bar foo bar foo foo. bar foo bar foo
- foo. bar foo bar foo foo. bar foo bar
- foo foo. bar foo bar foo foo. bar foo
- bar foo foo. bar foo bar foo foo.
+ This is bar.
+ bar foo bar foo foo. bar foo bar
+ foo foo. bar foo bar foo foo. bar
+ foo bar foo foo. bar foo bar foo
+ foo. bar foo bar foo foo. bar foo
+ bar foo foo.
+```
+```smarty
+{textformat style="email"}
- {textformat wrap=40 indent=4}
+This is foo.
+This is foo.
+This is foo.
+This is foo.
+This is foo.
+This is foo.
- This is foo.
- This is foo.
- This is foo.
- This is foo.
- This is foo.
- This is foo.
+This is bar.
- This is bar.
+bar foo bar foo foo.
+bar foo bar foo foo.
+bar foo bar foo foo.
+bar foo bar foo foo.
+bar foo bar foo foo.
+bar foo bar foo foo.
+bar foo bar foo foo.
- bar foo bar foo foo.
- bar foo bar foo foo.
- bar foo bar foo foo.
- bar foo bar foo foo.
- bar foo bar foo foo.
- bar foo bar foo foo.
- bar foo bar foo foo.
-
- {/textformat}
-
-
-
+{/textformat}
+```
The above example will output:
+```
+This is foo. This is foo. This is foo. This is foo. This is foo. This is
+foo.
- This is foo. This is foo. This is
- foo. This is foo. This is foo. This
- is foo.
+This is bar.
- This is bar.
+bar foo bar foo foo. bar foo bar foo foo. bar foo bar foo foo. bar foo
+bar foo foo. bar foo bar foo foo. bar foo bar foo foo. bar foo bar foo
+foo.
+```
+
- bar foo bar foo foo. bar foo bar foo
- foo. bar foo bar foo foo. bar foo
- bar foo foo. bar foo bar foo foo.
- bar foo bar foo foo. bar foo bar
- foo foo.
-
-
-
-
- {textformat wrap=40 indent=4 indent_first=4}
-
- This is foo.
- This is foo.
- This is foo.
- This is foo.
- This is foo.
- This is foo.
-
- This is bar.
-
- bar foo bar foo foo.
- bar foo bar foo foo.
- bar foo bar foo foo.
- bar foo bar foo foo.
- bar foo bar foo foo.
- bar foo bar foo foo.
- bar foo bar foo foo.
-
- {/textformat}
-
-
-
-The above example will output:
-
-
-
- This is foo. This is foo. This
- is foo. This is foo. This is foo.
- This is foo.
-
- This is bar.
-
- bar foo bar foo foo. bar foo bar
- foo foo. bar foo bar foo foo. bar
- foo bar foo foo. bar foo bar foo
- foo. bar foo bar foo foo. bar foo
- bar foo foo.
-
-
-
-
- {textformat style="email"}
-
- This is foo.
- This is foo.
- This is foo.
- This is foo.
- This is foo.
- This is foo.
-
- This is bar.
-
- bar foo bar foo foo.
- bar foo bar foo foo.
- bar foo bar foo foo.
- bar foo bar foo foo.
- bar foo bar foo foo.
- bar foo bar foo foo.
- bar foo bar foo foo.
-
- {/textformat}
-
-
-
-
-The above example will output:
-
-
-
- This is foo. This is foo. This is foo. This is foo. This is foo. This is
- foo.
-
- This is bar.
-
- bar foo bar foo foo. bar foo bar foo foo. bar foo bar foo foo. bar foo
- bar foo foo. bar foo bar foo foo. bar foo bar foo foo. bar foo bar foo
- foo.
-
-
-
-
-See also [`{strip}`](#language.function.strip) and
-[`wordwrap`](#language.modifier.wordwrap).
+See also [`{strip}`](../language-builtin-functions/language-function-strip.md) and
+[`wordwrap`](../language-modifiers/language-modifier-wordwrap.md).
diff --git a/docs/designers/language-modifiers.md b/docs/designers/language-modifiers/index.md
similarity index 54%
rename from docs/designers/language-modifiers.md
rename to docs/designers/language-modifiers/index.md
index a84e0e5e..5e6bb51e 100644
--- a/docs/designers/language-modifiers.md
+++ b/docs/designers/language-modifiers/index.md
@@ -1,39 +1,39 @@
# Variable Modifiers
Variable modifiers can be applied to
-[variables](./language-variables.md), [custom functions](./language-custom-functions.md)
+[variables](../language-variables/index.md), [custom functions](../language-custom-functions/index.md)
or strings. To apply a modifier,
specify the value followed by a `|` (pipe) and the modifier name. A
modifier may accept additional parameters that affect its behavior.
These parameters follow the modifier name and are separated by a `:`
(colon). Also, *all php-functions can be used as modifiers implicitly*
(more below) and modifiers can be
-[combined](./language-combining-modifiers.md).
+[combined](../language-combining-modifiers.md).
-- [capitalize](./language-modifiers/language-modifier-capitalize.md)
-- [cat](./language-modifiers/language-modifier-cat.md)
-- [count_characters](./language-modifiers/language-modifier-count-characters.md)
-- [count_paragraphs](./language-modifiers/language-modifier-count-paragraphs.md)
-- [count_sentences](./language-modifiers/language-modifier-count-sentences.md)
-- [count_words](./language-modifiers/language-modifier-count-words.md)
-- [date_format](./language-modifiers/language-modifier-date-format.md)
-- [default](./language-modifiers/language-modifier-default.md)
-- [escape](./language-modifiers/language-modifier-escape.md)
-- [from_charset](./language-modifiers/language-modifier-from-charset.md)
-- [indent](./language-modifiers/language-modifier-indent.md)
-- [lower](./language-modifiers/language-modifier-lower.md)
-- [nl2br](./language-modifiers/language-modifier-nl2br.md)
-- [regex_replace](./language-modifiers/language-modifier-regex-replace.md)
-- [replace](./language-modifiers/language-modifier-replace.md)
-- [spacify](./language-modifiers/language-modifier-spacify.md)
-- [string_format](./language-modifiers/language-modifier-string-format.md)
-- [strip](./language-modifiers/language-modifier-strip.md)
-- [strip_tags](./language-modifiers/language-modifier-strip-tags.md)
-- [to_charset](./language-modifiers/language-modifier-to-charset.md)
-- [truncate](./language-modifiers/language-modifier-truncate.md)
-- [unescape](./language-modifiers/language-modifier-unescape.md)
-- [upper](./language-modifiers/language-modifier-upper.md)
-- [wordwrap](./language-modifiers/language-modifier-wordwrap.md)
+- [capitalize](language-modifier-capitalize.md)
+- [cat](language-modifier-cat.md)
+- [count_characters](language-modifier-count-characters.md)
+- [count_paragraphs](language-modifier-count-paragraphs.md)
+- [count_sentences](language-modifier-count-sentences.md)
+- [count_words](language-modifier-count-words.md)
+- [date_format](language-modifier-date-format.md)
+- [default](language-modifier-default.md)
+- [escape](language-modifier-escape.md)
+- [from_charset](language-modifier-from-charset.md)
+- [indent](language-modifier-indent.md)
+- [lower](language-modifier-lower.md)
+- [nl2br](language-modifier-nl2br.md)
+- [regex_replace](language-modifier-regex-replace.md)
+- [replace](language-modifier-replace.md)
+- [spacify](language-modifier-spacify.md)
+- [string_format](language-modifier-string-format.md)
+- [strip](language-modifier-strip.md)
+- [strip_tags](language-modifier-strip-tags.md)
+- [to_charset](language-modifier-to-charset.md)
+- [truncate](language-modifier-truncate.md)
+- [unescape](language-modifier-unescape.md)
+- [upper](language-modifier-upper.md)
+- [wordwrap](language-modifier-wordwrap.md)
## Examples
@@ -100,6 +100,6 @@ These parameters follow the modifier name and are separated by a `:`
with the [`registerPlugin()`](../programmers/api-functions/api-register-plugin.md)
function.
-See also [`registerPlugin()`](../programmers/api-functions/api-register-plugin.md), [combining
-modifiers](./language-combining-modifiers.md). and [extending smarty with
-plugins](../programmers/plugins.md)
+See also [`registerPlugin()`](../../programmers/api-functions/api-register-plugin.md), [combining
+modifiers](../language-combining-modifiers.md). and [extending smarty with
+plugins](../../programmers/plugins.md)
diff --git a/docs/designers/language-modifiers/language-modifier-capitalize.md b/docs/designers/language-modifiers/language-modifier-capitalize.md
index 03e9d8c3..0368c7b3 100644
--- a/docs/designers/language-modifiers/language-modifier-capitalize.md
+++ b/docs/designers/language-modifiers/language-modifier-capitalize.md
@@ -1,41 +1,49 @@
-capitalize {#language.modifier.capitalize}
-==========
+# capitalize
This is used to capitalize the first letter of all words in a variable.
This is similar to the PHP [`ucwords()`](https://www.php.net/ucwords)
function.
- Parameter Position Type Required Default Description
- -------------------- --------- ---------- --------- -----------------------------------------------------------------------------------------------------------
- 1 boolean No FALSE This determines whether or not words with digits will be uppercased
- 2 boolean No FALSE This determines whether or not Capital letters within words should be lowercased, e.g. \"aAa\" to \"Aaa\"
+## Basic usage
+```smarty
+{$myVar|capitalize}
+```
+
+## Parameters
+
+| Parameter | Type | Required | Description |
+|-----------|---------|----------|-------------------------------------------------------------------------------------------------------|
+| 1 | boolean | No | This determines whether or not words with digits will be uppercased |
+| 2 | boolean | No | This determines whether or not Capital letters within words should be lowercased, e.g. "aAa" to "Aaa" |
- assign('articleTitle', 'next x-men film, x3, delayed.');
- ?>
-
+```
Where the template is:
-
+```smarty
{$articleTitle}
{$articleTitle|capitalize}
{$articleTitle|capitalize:true}
-
+```
Will output:
-
+```
next x-men film, x3, delayed.
Next X-Men Film, x3, Delayed.
Next X-Men Film, X3, Delayed.
-
+```
-See also [`lower`](#language.modifier.lower) and
-[`upper`](#language.modifier.upper)
+See also [`lower`](language-modifier-lower.md) and
+[`upper`](language-modifier-upper.md)
diff --git a/docs/designers/language-modifiers/language-modifier-cat.md b/docs/designers/language-modifiers/language-modifier-cat.md
index 1f43ae17..97dda4b3 100644
--- a/docs/designers/language-modifiers/language-modifier-cat.md
+++ b/docs/designers/language-modifiers/language-modifier-cat.md
@@ -1,31 +1,36 @@
-cat {#language.modifier.cat}
-===
+# cat
This value is concatenated to the given variable.
- Parameter Position Type Required Default Description
- -------------------- -------- ---------- --------- -----------------------------------------------
- 1 string No *empty* This value to catenate to the given variable.
+## Basic usage
+```smarty
+{$myVar|cat:' units'}
+```
+## Parameters
- assign('articleTitle', "Psychics predict world didn't end");
- ?>
-
-
+```
Where template is:
-
+```smarty
{$articleTitle|cat:' yesterday.'}
-
-
+```
Will output:
-
+```
Psychics predict world didn't end yesterday.
-
+```
diff --git a/docs/designers/language-modifiers/language-modifier-count-characters.md b/docs/designers/language-modifiers/language-modifier-count-characters.md
index 23bc00d5..8fc37d7a 100644
--- a/docs/designers/language-modifiers/language-modifier-count-characters.md
+++ b/docs/designers/language-modifiers/language-modifier-count-characters.md
@@ -1,39 +1,43 @@
-count\_characters {#language.modifier.count.characters}
-=================
+# count_characters
This is used to count the number of characters in a variable.
- Parameter Position Type Required Default Description
- -------------------- --------- ---------- --------- -------------------------------------------------------------------------------
- 1 boolean No FALSE This determines whether or not to include whitespace characters in the count.
+## Basic usage
+```smarty
+{$myVar|count_characters}
+```
+## Parameters
- assign('articleTitle', 'Cold Wave Linked to Temperatures.');
- ?>
-
-
+```
Where template is:
-
+```smarty
{$articleTitle}
{$articleTitle|count_characters}
{$articleTitle|count_characters:true}
-
-
+```
Will output:
-
+```
Cold Wave Linked to Temperatures.
29
33
-
+```
-
-See also [`count_words`](#language.modifier.count.words),
-[`count_sentences`](#language.modifier.count.sentences) and
-[`count_paragraphs`](#language.modifier.count.paragraphs).
+See also [`count_words`](language-modifier-count-words.md),
+[`count_sentences`](language-modifier-count-sentences.md) and
+[`count_paragraphs`](language-modifier-count-paragraphs.md).
diff --git a/docs/designers/language-modifiers/language-modifier-count-paragraphs.md b/docs/designers/language-modifiers/language-modifier-count-paragraphs.md
index 02c474e6..060cb98a 100644
--- a/docs/designers/language-modifiers/language-modifier-count-paragraphs.md
+++ b/docs/designers/language-modifiers/language-modifier-count-paragraphs.md
@@ -1,38 +1,41 @@
-count\_paragraphs {#language.modifier.count.paragraphs}
-=================
+# count_paragraphs
This is used to count the number of paragraphs in a variable.
+## Basic usage
+```smarty
+{$myVar|count_paragraphs}
+```
- assign('articleTitle',
"War Dims Hope for Peace. Child's Death Ruins Couple's Holiday.\n\n
Man is Fatally Slain. Death Causes Loneliness, Feeling of Isolation."
);
- ?>
-
-
+```
Where template is:
-
+```smarty
{$articleTitle}
{$articleTitle|count_paragraphs}
-
+```
Will output:
-
+```
War Dims Hope for Peace. Child's Death Ruins Couple's Holiday.
Man is Fatally Slain. Death Causes Loneliness, Feeling of Isolation.
2
+```
-
-
-See also [`count_characters`](#language.modifier.count.characters),
-[`count_sentences`](#language.modifier.count.sentences) and
-[`count_words`](#language.modifier.count.words).
+See also [`count_characters`](language-modifier-count-characters.md),
+[`count_sentences`](language-modifier-count-sentences.md) and
+[`count_words`](language-modifier-count-words.md).
diff --git a/docs/designers/language-modifiers/language-modifier-count-sentences.md b/docs/designers/language-modifiers/language-modifier-count-sentences.md
index 0a77ab82..dd2f69c6 100644
--- a/docs/designers/language-modifiers/language-modifier-count-sentences.md
+++ b/docs/designers/language-modifiers/language-modifier-count-sentences.md
@@ -1,37 +1,39 @@
-count\_sentences {#language.modifier.count.sentences}
-================
+# count_sentences
This is used to count the number of sentences in a variable. A sentence
being delimited by a dot, question- or exclamation-mark (.?!).
+## Basic usage
+```smarty
+{$myVar|count_sentences}
+```
- assign('articleTitle',
'Two Soviet Ships Collide - One Dies.
Enraged Cow Injures Farmer with Axe.'
);
- ?>
-
-
+```
Where template is:
-
+```smarty
{$articleTitle}
{$articleTitle|count_sentences}
-
-
+```
Will output:
-
+```
Two Soviet Ships Collide - One Dies. Enraged Cow Injures Farmer with Axe.
2
-
+```
-
-See also [`count_characters`](#language.modifier.count.characters),
-[`count_paragraphs`](#language.modifier.count.paragraphs) and
-[`count_words`](#language.modifier.count.words).
+See also [`count_characters`](language-modifier-count-characters.md),
+[`count_paragraphs`](language-modifier-count-paragraphs.md) and
+[`count_words`](language-modifier-count-words.md).
diff --git a/docs/designers/language-modifiers/language-modifier-count-words.md b/docs/designers/language-modifiers/language-modifier-count-words.md
index d25fbd5b..1ab0d1d4 100644
--- a/docs/designers/language-modifiers/language-modifier-count-words.md
+++ b/docs/designers/language-modifiers/language-modifier-count-words.md
@@ -1,33 +1,35 @@
-count\_words {#language.modifier.count.words}
-============
+# count_words
This is used to count the number of words in a variable.
+## Basic usage
+```smarty
+{$myVar|count_words}
+```
- assign('articleTitle', 'Dealers Will Hear Car Talk at Noon.');
- ?>
-
-
+```
Where template is:
-
+```smarty
{$articleTitle}
{$articleTitle|count_words}
-
-
+```
This will output:
-
+```
Dealers Will Hear Car Talk at Noon.
7
+```
-
-
-See also [`count_characters`](#language.modifier.count.characters),
-[`count_paragraphs`](#language.modifier.count.paragraphs) and
-[`count_sentences`](#language.modifier.count.sentences).
+See also [`count_characters`](language-modifier-count-characters.md),
+[`count_paragraphs`](language-modifier-count-paragraphs.md) and
+[`count_sentences`](language-modifier-count-sentences.md).
diff --git a/docs/designers/language-modifiers/language-modifier-date-format.md b/docs/designers/language-modifiers/language-modifier-date-format.md
index 6fd96b36..620d085b 100644
--- a/docs/designers/language-modifiers/language-modifier-date-format.md
+++ b/docs/designers/language-modifiers/language-modifier-date-format.md
@@ -1,5 +1,4 @@
-date\_format {#language.modifier.date.format}
-============
+# date_format
This formats a date and time into the given
[`strftime()`](https://www.php.net/strftime) format. Dates can be passed to
@@ -11,10 +10,17 @@ made up of month day year, parsable by php\'s
the date passed to `date_format` is empty and a second parameter is
passed, that will be used as the date to format.
- Parameter Position Type Required Default Description
- -------------------- -------- ---------- ------------ -------------------------------------------------
- 1 string No \%b %e, %Y This is the format for the outputted date.
- 2 string No n/a This is the default date if the input is empty.
+## Basic usage
+```smarty
+{$myVar|date_format:"%Y-%m-%d"}
+```
+
+## Parameters
+
+| Parameter Position | Type | Required | Default | Description |
+|--------------------|--------|----------|-----------|-------------------------------------------------|
+| 1 | string | No | %b %e, %Y | This is the format for the outputted date. |
+| 2 | string | No | n/a | This is the default date if the input is empty. |
> **Note**
>
@@ -33,143 +39,107 @@ passed, that will be used as the date to format.
> **Note**
>
-> `date_format` is essentially a wrapper to PHP\'s
+> `date_format` is essentially a wrapper to PHP's
> [`strftime()`](https://www.php.net/strftime) function. You may have more
-> or less conversion specifiers available depending on your system\'s
+> or less conversion specifiers available depending on your system's
> [`strftime()`](https://www.php.net/strftime) function where PHP was
> compiled. Check your system\'s manpage for a full list of valid
> specifiers. However, a few of the specifiers are emulated on Windows.
> These are: %D, %e, %h, %l, %n, %r, %R, %t, %T.
+## Examples
- assign('config', $config);
- $smarty->assign('yesterday', strtotime('-1 day'));
+$config['date'] = '%I:%M %p';
+$config['time'] = '%H:%M:%S';
+$smarty->assign('config', $config);
+$smarty->assign('yesterday', strtotime('-1 day'));
- ?>
+```
-
-
-This template uses [`$smarty.now`](#language.variables.smarty.now) to
+This template uses [`$smarty.now`](../language-variables/language-variables-smarty.md#smartynow-languagevariablessmartynow) to
get the current time:
-
- {$smarty.now|date_format}
- {$smarty.now|date_format:"%D"}
- {$smarty.now|date_format:$config.date}
- {$yesterday|date_format}
- {$yesterday|date_format:"%A, %B %e, %Y"}
- {$yesterday|date_format:$config.time}
-
-
+```smarty
+{$smarty.now|date_format}
+{$smarty.now|date_format:"%D"}
+{$smarty.now|date_format:$config.date}
+{$yesterday|date_format}
+{$yesterday|date_format:"%A, %B %e, %Y"}
+{$yesterday|date_format:$config.time}
+```
This above will output:
-
- Jan 1, 2022
- 01/01/22
- 02:33 pm
- Dec 31, 2021
- Monday, December 1, 2021
- 14:33:00
-
+```
+Jan 1, 2022
+01/01/22
+02:33 pm
+Dec 31, 2021
+Monday, December 1, 2021
+14:33:00
+```
+## Conversion specifiers
`date_format` conversion specifiers:
-- \%a - abbreviated weekday name according to the current locale
-
-- \%A - full weekday name according to the current locale
-
-- \%b - abbreviated month name according to the current locale
-
-- \%B - full month name according to the current locale
-
-- \%c - preferred date and time representation for the current locale
-
-- \%C - century number (the year divided by 100 and truncated to an
+- %a - abbreviated weekday name according to the current locale
+- %A - full weekday name according to the current locale
+- %b - abbreviated month name according to the current locale
+- %B - full month name according to the current locale
+- %c - preferred date and time representation for the current locale
+- %C - century number (the year divided by 100 and truncated to an
integer, range 00 to 99)
-
-- \%d - day of the month as a decimal number (range 01 to 31)
-
-- \%D - same as %m/%d/%y
-
-- \%e - day of the month as a decimal number, a single digit is
+- %d - day of the month as a decimal number (range 01 to 31)
+- %D - same as %m/%d/%y
+- %e - day of the month as a decimal number, a single digit is
preceded by a space (range 1 to 31)
-
-- \%g - Week-based year within century \[00,99\]
-
-- \%G - Week-based year, including the century \[0000,9999\]
-
-- \%h - same as %b
-
-- \%H - hour as a decimal number using a 24-hour clock (range 00
+- %g - Week-based year within century \[00,99\]
+- %G - Week-based year, including the century \[0000,9999\]
+- %h - same as %b
+- %H - hour as a decimal number using a 24-hour clock (range 00
to 23)
-
-- \%I - hour as a decimal number using a 12-hour clock (range 01
+- %I - hour as a decimal number using a 12-hour clock (range 01
to 12)
-
-- \%j - day of the year as a decimal number (range 001 to 366)
-
-- \%k - Hour (24-hour clock) single digits are preceded by a blank.
+- %j - day of the year as a decimal number (range 001 to 366)
+- %k - Hour (24-hour clock) single digits are preceded by a blank.
(range 0 to 23)
-
-- \%l - hour as a decimal number using a 12-hour clock, single digits
+- %l - hour as a decimal number using a 12-hour clock, single digits
preceded by a space (range 1 to 12)
-
-- \%m - month as a decimal number (range 01 to 12)
-
-- \%M - minute as a decimal number
-
-- \%n - newline character
-
-- \%p - either \`am\' or \`pm\' according to the given time value, or
+- %m - month as a decimal number (range 01 to 12)
+- %M - minute as a decimal number
+- %n - newline character
+- %p - either 'am' or 'pm' according to the given time value, or
the corresponding strings for the current locale
-
-- \%r - time in a.m. and p.m. notation
-
-- \%R - time in 24 hour notation
-
-- \%S - second as a decimal number
-
-- \%t - tab character
-
-- \%T - current time, equal to %H:%M:%S
-
-- \%u - weekday as a decimal number \[1,7\], with 1 representing
+- %r - time in a.m. and p.m. notation
+- %R - time in 24 hour notation
+- %S - second as a decimal number
+- %t - tab character
+- %T - current time, equal to %H:%M:%S
+- %u - weekday as a decimal number \[1,7\], with 1 representing
Monday
-
-- \%U - week number of the current year as a decimal number, starting
+- %U - week number of the current year as a decimal number, starting
with the first Sunday as the first day of the first week
-
-- \%V - The ISO 8601:1988 week number of the current year as a decimal
+- %V - The ISO 8601:1988 week number of the current year as a decimal
number, range 01 to 53, where week 1 is the first week that has at
least 4 days in the current year, and with Monday as the first day
of the week.
-
-- \%w - day of the week as a decimal, Sunday being 0
-
-- \%W - week number of the current year as a decimal number, starting
+- %w - day of the week as a decimal, Sunday being 0
+- %W - week number of the current year as a decimal number, starting
with the first Monday as the first day of the first week
-
-- \%x - preferred date representation for the current locale without
+- %x - preferred date representation for the current locale without
the time
-
-- \%X - preferred time representation for the current locale without
+- %X - preferred time representation for the current locale without
the date
+- %y - year as a decimal number without a century (range 00 to 99)
+- %Y - year as a decimal number including the century
+- %Z - time zone or name or abbreviation
+- %% - a literal '%' character
-- \%y - year as a decimal number without a century (range 00 to 99)
-
-- \%Y - year as a decimal number including the century
-
-- \%Z - time zone or name or abbreviation
-
-- \%% - a literal \`%\' character
-
-See also [`$smarty.now`](#language.variables.smarty.now),
+See also [`$smarty.now`](../language-variables/language-variables-smarty.md#smartynow-languagevariablessmartynow),
[`strftime()`](https://www.php.net/strftime),
-[`{html_select_date}`](#language.function.html.select.date) and the
-[date tips](#tips.dates) page.
+[`{html_select_date}`](../language-custom-functions/language-function-html-select-date.md) and the
+[date tips](../../appendixes/tips.md#dates) page.
diff --git a/docs/designers/language-modifiers/language-modifier-default.md b/docs/designers/language-modifiers/language-modifier-default.md
index ce08e96e..b8697a0d 100644
--- a/docs/designers/language-modifiers/language-modifier-default.md
+++ b/docs/designers/language-modifiers/language-modifier-default.md
@@ -1,41 +1,45 @@
-default {#language.modifier.default}
-=======
+# default
This is used to set a default value for a variable. If the variable is
unset or an empty string, the given default value is printed instead.
Default takes the one argument.
- Parameter Position Type Required Default Description
- -------------------- -------- ---------- --------- ---------------------------------------------------------------
- 1 string No *empty* This is the default value to output if the variable is empty.
+## Basic usage
+```smarty
+{$myVar|default:"(none)"}
+```
+## Parameters
- assign('articleTitle', 'Dealers Will Hear Car Talk at Noon.');
$smarty->assign('email', '');
- ?>
-
-
+```
Where template is:
-
- {$articleTitle|default:'no title'}
- {$myTitle|default:'no title'}
- {$email|default:'No email address available'}
-
-
+```smarty
+{$articleTitle|default:'no title'}
+{$myTitle|default:'no title'}
+{$email|default:'No email address available'}
+```
Will output:
+```
+Dealers Will Hear Car Talk at Noon.
+no title
+No email address available
+```
- Dealers Will Hear Car Talk at Noon.
- no title
- No email address available
-
-
-
-See also the [default variable handling](#tips.default.var.handling) and
-the [blank variable handling](#tips.blank.var.handling) pages.
+See also the [default variable handling](../../appendixes/tips.md#default-variable-handling) and
+the [blank variable handling](../../appendixes/tips.md#blank-variable-handling) pages.
diff --git a/docs/designers/language-modifiers/language-modifier-escape.md b/docs/designers/language-modifiers/language-modifier-escape.md
index 27d711f3..6fd5dd2b 100644
--- a/docs/designers/language-modifiers/language-modifier-escape.md
+++ b/docs/designers/language-modifiers/language-modifier-escape.md
@@ -1,74 +1,78 @@
-escape {#language.modifier.escape}
-======
+# escape
`escape` is used to encode or escape a variable to `html`, `url`,
`single quotes`, `hex`, `hexentity`, `javascript` and `mail`. By default
its `html`.
- Parameter Position Type Required Possible Values Default Description
- -------------------- --------- ---------- ------------------------------------------------------------------------------------------------------------ --------- -------------------------------------------------------------------------------------
- 1 string No `html`, `htmlall`, `url`, `urlpathinfo`, `quotes`, `hex`, `hexentity`, `javascript`, `mail` `html` This is the escape format to use.
- 2 string No `ISO-8859-1`, `UTF-8`, and any character set supported by [`htmlentities()`](https://www.php.net/htmlentities) `UTF-8` The character set encoding passed to htmlentities() et. al.
- 3 boolean No FALSE TRUE Double encode entites from & to & (applys to `html` and `htmlall` only)
+## Basic usage
+```smarty
+{$myVar|escape}
+```
+
+## Parameters
+
+| Parameter Position | Type | Required | Possible Values | Default | Description |
+|--------------------|---------|----------|----------------------------------------------------------------------------------------------------------------|---------|--------------------------------------------------------------------------------------|
+| 1 | string | No | `html`, `htmlall`, `url`, `urlpathinfo`, `quotes`, `hex`, `hexentity`, `javascript`, `mail` | `html` | This is the escape format to use. |
+| 2 | string | No | `ISO-8859-1`, `UTF-8`, and any character set supported by [`htmlentities()`](https://www.php.net/htmlentities) | `UTF-8` | The character set encoding passed to htmlentities() et. al. |
+| 3 | boolean | No | FALSE | TRUE | Double encode entities from & to & (applies to `html` and `htmlall` only) |
- assign('articleTitle',
- "'Stiff Opposition Expected to Casketless Funeral Plan'"
- );
- $smarty->assign('EmailAddress','smarty@example.com');
+```php
+
+$smarty->assign('articleTitle',
+ "'Stiff Opposition Expected to Casketless Funeral Plan'"
+ );
+$smarty->assign('EmailAddress','smarty@example.com');
+```
These are example `escape` template lines followed by the output
+```smarty
+{$articleTitle}
+'Stiff Opposition Expected to Casketless Funeral Plan'
- {$articleTitle}
- 'Stiff Opposition Expected to Casketless Funeral Plan'
+{$articleTitle|escape}
+'Stiff Opposition Expected to Casketless Funeral Plan'
- {$articleTitle|escape}
- 'Stiff Opposition Expected to Casketless Funeral Plan'
+{$articleTitle|escape:'html'} {* escapes & " ' < > *}
+'Stiff Opposition Expected to Casketless Funeral Plan'
- {$articleTitle|escape:'html'} {* escapes & " ' < > *}
- 'Stiff Opposition Expected to Casketless Funeral Plan'
+{$articleTitle|escape:'htmlall'} {* escapes ALL html entities *}
+'Stiff Opposition Expected to Casketless Funeral Plan'
- {$articleTitle|escape:'htmlall'} {* escapes ALL html entities *}
- 'Stiff Opposition Expected to Casketless Funeral Plan'
+click here
+click here
- click here
- click here
+{$articleTitle|escape:'quotes'}
+\'Stiff Opposition Expected to Casketless Funeral Plan\'
- {$articleTitle|escape:'quotes'}
- \'Stiff Opposition Expected to Casketless Funeral Plan\'
+{$EmailAddress|escape:"hexentity"}
+{$EmailAddress|escape:'mail'} {* this converts to email to text *}
+bob..snip..et
- {$EmailAddress|escape:"hexentity"}
- {$EmailAddress|escape:'mail'} {* this converts to email to text *}
- bob..snip..et
+{'mail@example.com'|escape:'mail'}
+smarty [AT] example [DOT] com
- {'mail@example.com'|escape:'mail'}
- smarty [AT] example [DOT] com
+{* the "rewind" parameter registers the current location *}
+click here
-
-
-
- {* the "rewind" parameter registers the current location *}
- click here
-
-
+```
This snippet is useful for emails, but see also
-[`{mailto}`](#language.function.mailto)
+[`{mailto}`](../language-custom-functions/language-function-mailto.md)
+```smarty
+{* email address mangled *}
+{$EmailAddress|escape:'mail'}
+```
- {* email address mangled *}
- {$EmailAddress|escape:'mail'}
-
-
-
-See also [escaping smarty parsing](#language.escaping),
-[`{mailto}`](#language.function.mailto) and the [obfuscating email
-addresses](#tips.obfuscating.email) page.
+See also [escaping smarty parsing](../language-basic-syntax/language-escaping.md),
+[`{mailto}`](../language-custom-functions/language-function-mailto.md) and the [obfuscating email
+addresses](../../appendixes/tips.md#obfuscating-e-mail-addresses) page.
diff --git a/docs/designers/language-modifiers/language-modifier-from-charset.md b/docs/designers/language-modifiers/language-modifier-from-charset.md
index d6c01f99..bf4b4769 100644
--- a/docs/designers/language-modifiers/language-modifier-from-charset.md
+++ b/docs/designers/language-modifiers/language-modifier-from-charset.md
@@ -1,13 +1,14 @@
-from\_charset {#language.modifier.from_charset}
-=============
+# from_charset
`from_charset` is used to transcode a string from a given charset to the
-internal charset. This is the exact opposite of the [to\_charset
-modifier](#language.modifier.to_charset).
+internal charset. This is the exact opposite of the [to_charset
+modifier](language-modifier-to-charset.md).
- Parameter Position Type Required Possible Values Default Description
- -------------------- -------- ---------- -------------------------------------------------------------------------------------------------------------------------- -------------- ---------------------------------------------------------------
- 1 string No `ISO-8859-1`, `UTF-8`, and any character set supported by [`mb_convert_encoding()`](https://www.php.net/mb_convert_encoding) `ISO-8859-1` The charset encoding the value is supposed to be decoded from
+## Parameters
+
+| Parameter Position | Type | Required | Possible Values | Default | Description |
+|--------------------|--------|----------|------------------------------------------------------------------------------------------------------------------------------|--------------|---------------------------------------------------------------|
+| 1 | string | No | `ISO-8859-1`, `UTF-8`, and any character set supported by [`mb_convert_encoding()`](https://www.php.net/mb_convert_encoding) | `ISO-8859-1` | The charset encoding the value is supposed to be decoded from |
> **Note**
>
@@ -15,5 +16,5 @@ modifier](#language.modifier.to_charset).
> modifier should only be used in cases where the application cannot
> anticipate that a certain string is required in another encoding.
-See also [Charset Encoding](#charset), [from\_charset
-modifier](#language.modifier.from_charset).
+See also [Charset Encoding](../../programmers/charset.md), [to_charset
+modifier](language-modifier-to-charset.md).
diff --git a/docs/designers/language-modifiers/language-modifier-indent.md b/docs/designers/language-modifiers/language-modifier-indent.md
index d0264dca..9fa3540a 100644
--- a/docs/designers/language-modifiers/language-modifier-indent.md
+++ b/docs/designers/language-modifiers/language-modifier-indent.md
@@ -1,62 +1,67 @@
-indent {#language.modifier.indent}
-======
+# indent
This indents a string on each line, default is 4. As an optional
parameter, you can specify the number of characters to indent. As an
optional second parameter, you can specify the character to use to
-indent with eg use `"\t"` for a tab.
+indent with. For example: use `"\t"` for a tab.
- Parameter Position Type Required Default Description
- -------------------- --------- ---------- ------------- ---------------------------------------------------
- 1 integer No 4 This determines how many characters to indent to.
- 2 string No (one space) This is the character used to indent with.
+## Basic usage
+```smarty
+{$myVar|indent:4}
+```
+## Parameters
- assign('articleTitle',
- 'NJ judge to rule on nude beach.
- Sun or rain expected today, dark tonight.
- Statistics show that teen pregnancy drops off significantly after 25.'
- );
- ?>
+## Examples
-
+```php
+assign('articleTitle',
+ 'NJ judge to rule on nude beach.
+Sun or rain expected today, dark tonight.
+Statistics show that teen pregnancy drops off significantly after 25.'
+ );
+```
Where template is:
+```smarty
+{$articleTitle}
- {$articleTitle}
+{$articleTitle|indent}
- {$articleTitle|indent}
-
- {$articleTitle|indent:10}
-
- {$articleTitle|indent:1:"\t"}
+{$articleTitle|indent:10}
+{$articleTitle|indent:1:"\t"}
+```
-
Will output:
+```
+NJ judge to rule on nude beach.
+Sun or rain expected today, dark tonight.
+Statistics show that teen pregnancy drops off significantly after 25.
NJ judge to rule on nude beach.
Sun or rain expected today, dark tonight.
Statistics show that teen pregnancy drops off significantly after 25.
+ NJ judge to rule on nude beach.
+ Sun or rain expected today, dark tonight.
+ Statistics show that teen pregnancy drops off significantly after 25.
+
NJ judge to rule on nude beach.
Sun or rain expected today, dark tonight.
Statistics show that teen pregnancy drops off significantly after 25.
-
- NJ judge to rule on nude beach.
- Sun or rain expected today, dark tonight.
- Statistics show that teen pregnancy drops off significantly after 25.
-
- NJ judge to rule on nude beach.
- Sun or rain expected today, dark tonight.
- Statistics show that teen pregnancy drops off significantly after 25.
-
+```
-See also [`strip`](#language.modifier.strip),
-[`wordwrap`](#language.modifier.wordwrap) and
-[`spacify`](#language.modifier.spacify).
+See also [`strip`](language-modifier-strip.md),
+[`wordwrap`](language-modifier-wordwrap.md) and
+[`spacify`](language-modifier-spacify.md).
diff --git a/docs/designers/language-modifiers/language-modifier-lower.md b/docs/designers/language-modifiers/language-modifier-lower.md
index b8b5a2c0..e5e6886f 100644
--- a/docs/designers/language-modifiers/language-modifier-lower.md
+++ b/docs/designers/language-modifiers/language-modifier-lower.md
@@ -1,33 +1,34 @@
-lower {#language.modifier.lower}
-=====
+# lower
This is used to lowercase a variable. This is equivalent to the PHP
[`strtolower()`](https://www.php.net/strtolower) function.
+## Basic usage
+```smarty
+{$myVar|lower}
+```
- assign('articleTitle', 'Two Convicts Evade Noose, Jury Hung.');
+```php
+
-
-
+$smarty->assign('articleTitle', 'Two Convicts Evade Noose, Jury Hung.');
+```
Where template is:
-
- {$articleTitle}
- {$articleTitle|lower}
-
-
+```smarty
+{$articleTitle}
+{$articleTitle|lower}
+```
This will output:
-
- Two Convicts Evade Noose, Jury Hung.
- two convicts evade noose, jury hung.
-
+```
+Two Convicts Evade Noose, Jury Hung.
+two convicts evade noose, jury hung.
+```
-
-See also [`upper`](#language.modifier.upper) and
-[`capitalize`](#language.modifier.capitalize).
+See also [`upper`](language-modifier-upper.md) and
+[`capitalize`](language-modifier-capitalize.md).
diff --git a/docs/designers/language-modifiers/language-modifier-nl2br.md b/docs/designers/language-modifiers/language-modifier-nl2br.md
index 69556766..2808716f 100644
--- a/docs/designers/language-modifiers/language-modifier-nl2br.md
+++ b/docs/designers/language-modifiers/language-modifier-nl2br.md
@@ -1,35 +1,37 @@
-nl2br
-=====
+# nl2br
All `"\n"` line breaks will be converted to html ` ` tags in the
given variable. This is equivalent to the PHP\'s
[`nl2br()`](https://www.php.net/nl2br) function.
+## Basic usage
+```smarty
+{$myVar|nl2br}
+```
- assign('articleTitle',
- "Sun or rain expected\ntoday, dark tonight"
- );
+```php
+
+$smarty->assign('articleTitle',
+ "Sun or rain expected\ntoday, dark tonight"
+ );
-
+```
Where the template is:
-
- {$articleTitle|nl2br}
-
+```smarty
+{$articleTitle|nl2br}
+```
-
Will output:
+```
+Sun or rain expected today, dark tonight
+```
- Sun or rain expected today, dark tonight
-
-
-
-See also [`word_wrap`](#language.modifier.wordwrap),
-[`count_paragraphs`](#language.modifier.count.paragraphs) and
-[`count_sentences`](#language.modifier.count.sentences).
+See also [`word_wrap`](language-modifier-wordwrap.md),
+[`count_paragraphs`](language-modifier-count-paragraphs.md) and
+[`count_sentences`](language-modifier-count-sentences.md).
diff --git a/docs/designers/language-modifiers/language-modifier-regex-replace.md b/docs/designers/language-modifiers/language-modifier-regex-replace.md
index acc0008a..033d2a43 100644
--- a/docs/designers/language-modifiers/language-modifier-regex-replace.md
+++ b/docs/designers/language-modifiers/language-modifier-regex-replace.md
@@ -1,10 +1,14 @@
-regex\_replace {#language.modifier.regex.replace}
-==============
+# regex_replace
A regular expression search and replace on a variable. Use the
[`preg_replace()`](https://www.php.net/preg_replace) syntax from the PHP
manual.
+## Basic usage
+```smarty
+{$myVar|regex_replace:"/foo/":"bar"}
+```
+
> **Note**
>
> Although Smarty supplies this regex convenience modifier, it is
@@ -12,40 +16,40 @@ manual.
> functions or modifiers. Regular expressions are considered application
> code and are not part of presentation logic.
-Parameters
+## Parameters
- Parameter Position Type Required Default Description
- -------------------- -------- ---------- --------- ------------------------------------------------
- 1 string Yes *n/a* This is the regular expression to be replaced.
- 2 string Yes *n/a* This is the string of text to replace with.
+| Parameter Position | Type | Required | Description |
+|--------------------|--------|----------|------------------------------------------------|
+| 1 | string | Yes | This is the regular expression to be replaced. |
+| 2 | string | Yes | This is the string of text to replace with. |
- assign('articleTitle', "Infertility unlikely to\nbe passed on, experts say.");
+```php
+
+$smarty->assign('articleTitle', "Infertility unlikely to\nbe passed on, experts say.");
-
+```
Where template is:
+```smarty
+{* replace each carriage return, tab and new line with a space *}
- {* replace each carriage return, tab and new line with a space *}
-
- {$articleTitle}
- {$articleTitle|regex_replace:"/[\r\t\n]/":" "}
-
+{$articleTitle}
+{$articleTitle|regex_replace:"/[\r\t\n]/":" "}
+```
-
Will output:
-
- Infertility unlikely to
- be passed on, experts say.
- Infertility unlikely to be passed on, experts say.
-
+```
+Infertility unlikely to
+be passed on, experts say.
+Infertility unlikely to be passed on, experts say.
+```
-See also [`replace`](#language.modifier.replace) and
-[`escape`](#language.modifier.escape).
+See also [`replace`](language-modifier-replace.md) and
+[`escape`](language-modifier-escape.md).
diff --git a/docs/designers/language-modifiers/language-modifier-replace.md b/docs/designers/language-modifiers/language-modifier-replace.md
index cdff14fb..0e01ab46 100644
--- a/docs/designers/language-modifiers/language-modifier-replace.md
+++ b/docs/designers/language-modifiers/language-modifier-replace.md
@@ -1,40 +1,45 @@
-replace {#language.modifier.replace}
-=======
+# replace
A simple search and replace on a variable. This is equivalent to the
-PHP\'s [`str_replace()`](https://www.php.net/str_replace) function.
+PHP's [`str_replace()`](https://www.php.net/str_replace) function.
- Parameter Position Type Required Default Description
- -------------------- -------- ---------- --------- ---------------------------------------------
- 1 string Yes *n/a* This is the string of text to be replaced.
- 2 string Yes *n/a* This is the string of text to replace with.
+## Basic usage
+```smarty
+{$myVar|replace:"foo":"bar"}
+```
+
+## Parameters
+
+| Parameter Position | Type | Required | Description |
+|--------------------|--------|----------|---------------------------------------------|
+| 1 | string | Yes | This is the string of text to be replaced. |
+| 2 | string | Yes | This is the string of text to replace with. |
- assign('articleTitle', "Child's Stool Great for Use in Garden.");
+```php
+
+$smarty->assign('articleTitle', "Child's Stool Great for Use in Garden.");
-
+```
Where template is:
-
- {$articleTitle}
- {$articleTitle|replace:'Garden':'Vineyard'}
- {$articleTitle|replace:' ':' '}
-
+```smarty
+{$articleTitle}
+{$articleTitle|replace:'Garden':'Vineyard'}
+{$articleTitle|replace:' ':' '}
+```
-
Will output:
+```
+Child's Stool Great for Use in Garden.
+Child's Stool Great for Use in Vineyard.
+Child's Stool Great for Use in Garden.
+```
- Child's Stool Great for Use in Garden.
- Child's Stool Great for Use in Vineyard.
- Child's Stool Great for Use in Garden.
-
-
-
-See also [`regex_replace`](#language.modifier.regex.replace) and
-[`escape`](#language.modifier.escape).
+See also [`regex_replace`](language-modifier-regex-replace.md) and
+[`escape`](language-modifier-escape.md).
diff --git a/docs/designers/language-modifiers/language-modifier-spacify.md b/docs/designers/language-modifiers/language-modifier-spacify.md
index 8856dab4..229e2d22 100644
--- a/docs/designers/language-modifiers/language-modifier-spacify.md
+++ b/docs/designers/language-modifiers/language-modifier-spacify.md
@@ -1,40 +1,44 @@
-spacify {#language.modifier.spacify}
-=======
+# spacify
`spacify` is a way to insert a space between every character of a
variable. You can optionally pass a different character or string to
insert.
- Parameter Position Type Required Default Description
- -------------------- -------- ---------- ------------- -----------------------------------------------------------------
- 1 string No *one space* This what gets inserted between each character of the variable.
+## Basic usage
+```smarty
+{$myVar|spacify}
+```
+## Parameters
- assign('articleTitle', 'Something Went Wrong in Jet Crash, Experts Say.');
+## Examples
- ?>
+```php
+assign('articleTitle', 'Something Went Wrong in Jet Crash, Experts Say.');
+
+```
Where template is:
-
- {$articleTitle}
- {$articleTitle|spacify}
- {$articleTitle|spacify:"^^"}
-
-
+```smarty
+{$articleTitle}
+{$articleTitle|spacify}
+{$articleTitle|spacify:"^^"}
+```
Will output:
+```
+Something Went Wrong in Jet Crash, Experts Say.
+S o m e t h i n g W .... snip .... s h , E x p e r t s S a y .
+S^^o^^m^^e^^t^^h^^i^^n^^g^^ .... snip .... ^^e^^r^^t^^s^^ ^^S^^a^^y^^.
+```
- Something Went Wrong in Jet Crash, Experts Say.
- S o m e t h i n g W .... snip .... s h , E x p e r t s S a y .
- S^^o^^m^^e^^t^^h^^i^^n^^g^^ .... snip .... ^^e^^r^^t^^s^^ ^^S^^a^^y^^.
-
-
-
-See also [`wordwrap`](#language.modifier.wordwrap) and
-[`nl2br`](#language.modifier.nl2br).
+See also [`wordwrap`](language-modifier-wordwrap.md) and
+[`nl2br`](language-modifier-nl2br.md).
diff --git a/docs/designers/language-modifiers/language-modifier-string-format.md b/docs/designers/language-modifiers/language-modifier-string-format.md
index 70a77966..6163a078 100644
--- a/docs/designers/language-modifiers/language-modifier-string-format.md
+++ b/docs/designers/language-modifiers/language-modifier-string-format.md
@@ -1,39 +1,43 @@
-string\_format {#language.modifier.string.format}
-==============
+# string_format
This is a way to format strings, such as decimal numbers and such. Use
the syntax for [`sprintf()`](https://www.php.net/sprintf) for the
formatting.
- Parameter Position Type Required Default Description
- -------------------- -------- ---------- --------- ---------------------------------------
- 1 string Yes *n/a* This is what format to use. (sprintf)
+## Basic usage
+```smarty
+{$myVar|string_format:"%d"}
+```
+## Parameters
- assign('number', 23.5787446);
+## Examples
- ?>
+```php
+assign('number', 23.5787446);
+
+```
Where template is:
-
- {$number}
- {$number|string_format:"%.2f"}
- {$number|string_format:"%d"}
-
-
+```smarty
+{$number}
+{$number|string_format:"%.2f"}
+{$number|string_format:"%d"}
+```
Will output:
+```
+23.5787446
+23.58
+23
+```
- 23.5787446
- 23.58
- 23
-
-
-
-See also [`date_format`](#language.modifier.date.format).
+See also [`date_format`](language-modifier-date-format.md).
diff --git a/docs/designers/language-modifiers/language-modifier-strip-tags.md b/docs/designers/language-modifiers/language-modifier-strip-tags.md
index 4a019767..7d94fdd0 100644
--- a/docs/designers/language-modifiers/language-modifier-strip-tags.md
+++ b/docs/designers/language-modifiers/language-modifier-strip-tags.md
@@ -1,41 +1,46 @@
-strip\_tags {#language.modifier.strip.tags}
-===========
+# strip_tags
-This strips out markup tags, basically anything between `<` and `>`.
+This strips out HTML markup tags, basically anything between `<` and `>`.
- Parameter Position Type Required Default Description
- -------------------- ------ ---------- --------- ----------------------------------------------------------------
- 1 bool No TRUE This determines whether the tags are replaced by \' \' or \'\'
+## Basic usage
+```smarty
+{$myVar|strip_tags}
+```
+## Parameters
- assign('articleTitle',
- "Blind Woman Gets New
- Kidney from Dad she Hasn't Seen in years."
- );
+## Examples
- ?>
+```php
+assign('articleTitle',
+ "Blind Woman Gets New
+Kidney from Dad she Hasn't Seen in years."
+ );
+
+```
Where template is:
-
- {$articleTitle}
- {$articleTitle|strip_tags} {* same as {$articleTitle|strip_tags:true} *}
- {$articleTitle|strip_tags:false}
-
-
+```smarty
+{$articleTitle}
+{$articleTitle|strip_tags} {* same as {$articleTitle|strip_tags:true} *}
+{$articleTitle|strip_tags:false}
+```
Will output:
+```html
+Blind Woman Gets New Kidney from Dad she Hasn't Seen in years.
+Blind Woman Gets New Kidney from Dad she Hasn't Seen in years .
+Blind Woman Gets New Kidney from Dad she Hasn't Seen in years.
+```
- Blind Woman Gets New Kidney from Dad she Hasn't Seen in years.
- Blind Woman Gets New Kidney from Dad she Hasn't Seen in years .
- Blind Woman Gets New Kidney from Dad she Hasn't Seen in years.
-
-
-
-See also [`replace`](#language.modifier.replace) and
-[`regex_replace`](#language.modifier.regex.replace).
+See also [`replace`](language-modifier-replace.md) and
+[`regex_replace`](language-modifier-regex-replace.md).
diff --git a/docs/designers/language-modifiers/language-modifier-strip.md b/docs/designers/language-modifiers/language-modifier-strip.md
index 7027e031..b7bdc282 100644
--- a/docs/designers/language-modifiers/language-modifier-strip.md
+++ b/docs/designers/language-modifiers/language-modifier-strip.md
@@ -1,40 +1,42 @@
-strip {#language.modifier.strip}
-=====
+# strip
This replaces all spaces, newlines and tabs with a single space, or with
the supplied string.
+## Basic usage
+```smarty
+{$myVar|strip}
+```
+
> **Note**
>
> If you want to strip blocks of template text, use the built-in
-> [`{strip}`](#language.function.strip) function.
+> [`{strip}`](../language-builtin-functions/language-function-strip.md) function.
+## Examples
- assign('articleTitle', "Grandmother of\neight makes\t hole in one.");
- $smarty->display('index.tpl');
- ?>
-
-
+```php
+assign('articleTitle', "Grandmother of\neight makes\t hole in one.");
+$smarty->display('index.tpl');
+```
Where template is:
-
- {$articleTitle}
- {$articleTitle|strip}
- {$articleTitle|strip:' '}
-
-
+```smarty
+{$articleTitle}
+{$articleTitle|strip}
+{$articleTitle|strip:' '}
+```
Will output:
+```html
+Grandmother of
+eight makes hole in one.
+Grandmother of eight makes hole in one.
+Grandmother of eight makes hole in one.
+```
- Grandmother of
- eight makes hole in one.
- Grandmother of eight makes hole in one.
- Grandmother of eight makes hole in one.
-
-
-
-See also [`{strip}`](#language.function.strip) and
-[`truncate`](#language.modifier.truncate).
+See also [`{strip}`](../language-builtin-functions/language-function-strip.md) and
+[`truncate`](language-modifier-truncate.md).
diff --git a/docs/designers/language-modifiers/language-modifier-to-charset.md b/docs/designers/language-modifiers/language-modifier-to-charset.md
index 9389a5ed..c0b00384 100644
--- a/docs/designers/language-modifiers/language-modifier-to-charset.md
+++ b/docs/designers/language-modifiers/language-modifier-to-charset.md
@@ -1,13 +1,14 @@
-to\_charset {#language.modifier.to_charset}
-===========
+# to_charset
`to_charset` is used to transcode a string from the internal charset to
-a given charset. This is the exact opposite of the [from\_charset
+a given charset. This is the exact opposite of the [from_charset
modifier](#language.modifier.from_charset).
- Parameter Position Type Required Possible Values Default Description
- -------------------- -------- ---------- -------------------------------------------------------------------------------------------------------------------------- -------------- -------------------------------------------------------------
- 1 string No `ISO-8859-1`, `UTF-8`, and any character set supported by [`mb_convert_encoding()`](https://www.php.net/mb_convert_encoding) `ISO-8859-1` The charset encoding the value is supposed to be encoded to
+## Parameters
+
+| Parameter Position | Type | Required | Possible Values | Default | Description |
+|--------------------|--------|----------|------------------------------------------------------------------------------------------------------------------------------|--------------|-------------------------------------------------------------|
+| 1 | string | No | `ISO-8859-1`, `UTF-8`, and any character set supported by [`mb_convert_encoding()`](https://www.php.net/mb_convert_encoding) | `ISO-8859-1` | The charset encoding the value is supposed to be encoded to |
> **Note**
>
@@ -15,5 +16,5 @@ modifier](#language.modifier.from_charset).
> modifier should only be used in cases where the application cannot
> anticipate that a certain string is required in another encoding.
-See also [Charset Encoding](#charset), [from\_charset
-modifier](#language.modifier.from_charset).
+See also [Charset Encoding](../../programmers/charset.md), [from_charset
+modifier](language-modifier-from-charset.md).
diff --git a/docs/designers/language-modifiers/language-modifier-truncate.md b/docs/designers/language-modifiers/language-modifier-truncate.md
index 2303a543..1cbb7abc 100644
--- a/docs/designers/language-modifiers/language-modifier-truncate.md
+++ b/docs/designers/language-modifiers/language-modifier-truncate.md
@@ -1,5 +1,4 @@
-truncate {#language.modifier.truncate}
-========
+# truncate
This truncates a variable to a character length, the default is 80. As
an optional second parameter, you can specify a string of text to
@@ -9,44 +8,50 @@ string are included with the original truncation length. By default,
cut off at the exact character length, pass the optional third parameter
of TRUE.
- Parameter Position Type Required Default Description
- -------------------- --------- ---------- --------- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- 1 integer No 80 This determines how many characters to truncate to.
- 2 string No \... This is a text string that replaces the truncated text. Its length is included in the truncation length setting.
- 3 boolean No FALSE This determines whether or not to truncate at a word boundary with FALSE, or at the exact character with TRUE.
- 4 boolean No FALSE This determines whether the truncation happens at the end of the string with FALSE, or in the middle of the string with TRUE. Note that if this setting is TRUE, then word boundaries are ignored.
+## Basic usage
+```smarty
+{$myVar|truncate:40:"..."}
+```
+## Parameters
- assign('articleTitle', 'Two Sisters Reunite after Eighteen Years at Checkout Counter.');
- ?>
+| Parameter Position | Type | Required | Default | Description |
+|--------------------|---------|----------|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| 1 | integer | No | 80 | This determines how many characters to truncate to. |
+| 2 | string | No | \... | This is a text string that replaces the truncated text. Its length is included in the truncation length setting. |
+| 3 | boolean | No | FALSE | This determines whether or not to truncate at a word boundary with FALSE, or at the exact character with TRUE. |
+| 4 | boolean | No | FALSE | This determines whether the truncation happens at the end of the string with FALSE, or in the middle of the string with TRUE. Note that if this setting is TRUE, then word boundaries are ignored. |
-
+## Examples
+
+```php
+assign('articleTitle', 'Two Sisters Reunite after Eighteen Years at Checkout Counter.');
+```
where template is:
-
- {$articleTitle}
- {$articleTitle|truncate}
- {$articleTitle|truncate:30}
- {$articleTitle|truncate:30:""}
- {$articleTitle|truncate:30:"---"}
- {$articleTitle|truncate:30:"":true}
- {$articleTitle|truncate:30:"...":true}
- {$articleTitle|truncate:30:'..':true:true}
-
-
+```smarty
+{$articleTitle}
+{$articleTitle|truncate}
+{$articleTitle|truncate:30}
+{$articleTitle|truncate:30:""}
+{$articleTitle|truncate:30:"---"}
+{$articleTitle|truncate:30:"":true}
+{$articleTitle|truncate:30:"...":true}
+{$articleTitle|truncate:30:'..':true:true}
+```
This will output:
-
- Two Sisters Reunite after Eighteen Years at Checkout Counter.
- Two Sisters Reunite after Eighteen Years at Checkout Counter.
- Two Sisters Reunite after...
- Two Sisters Reunite after
- Two Sisters Reunite after---
- Two Sisters Reunite after Eigh
- Two Sisters Reunite after E...
- Two Sisters Re..ckout Counter.
-
+```
+Two Sisters Reunite after Eighteen Years at Checkout Counter.
+Two Sisters Reunite after Eighteen Years at Checkout Counter.
+Two Sisters Reunite after...
+Two Sisters Reunite after
+Two Sisters Reunite after---
+Two Sisters Reunite after Eigh
+Two Sisters Reunite after E...
+Two Sisters Re..ckout Counter.
+```
diff --git a/docs/designers/language-modifiers/language-modifier-unescape.md b/docs/designers/language-modifiers/language-modifier-unescape.md
index 1fe9a264..8e860305 100644
--- a/docs/designers/language-modifiers/language-modifier-unescape.md
+++ b/docs/designers/language-modifiers/language-modifier-unescape.md
@@ -1,39 +1,43 @@
-unescape {#language.modifier.unescape}
-========
+# unescape
`unescape` is used to decode `entity`, `html` and `htmlall`. It counters
-the effects of the [escape modifier](#language.modifier.escape) for the
+the effects of the [escape modifier](language-modifier-escape.md) for the
given types.
- Parameter Position Type Required Possible Values Default Description
- -------------------- -------- ---------- ------------------------------------------------------------------------------------------------------------ --------- ------------------------------------------------------------------------------------------------------------------------------
- 1 string No `html`, `htmlall`, `entity`, `html` This is the escape format to use.
- 2 string No `ISO-8859-1`, `UTF-8`, and any character set supported by [`htmlentities()`](https://www.php.net/htmlentities) `UTF-8` The character set encoding passed to html\_entity\_decode() or htmlspecialchars\_decode() or mb\_convert\_encoding() et. al.
+## Basic usage
+```smarty
+{$myVar|unescape}
+```
+## Parameters
- assign('articleTitle',
- "Germans use "Ümlauts" and pay in €uro"
- );
+## Examples
- ?>
+```php
+assign('articleTitle',
+ "Germans use "Ümlauts" and pay in €uro"
+ );
+```
These are example `unescape` template lines followed by the output
+```smarty
+{$articleTitle}
+Germans use "Ümlauts" and pay in €uro
- {$articleTitle}
- Germans use "Ümlauts" and pay in €uro
+{$articleTitle|unescape:"html"}
+Germans use "Ümlauts" and pay in €uro
- {$articleTitle|unescape:"html"}
- Germans use "Ümlauts" and pay in €uro
+{$articleTitle|unescape:"htmlall"}
+Germans use "Ümlauts" and pay in €uro
+```
- {$articleTitle|unescape:"htmlall"}
- Germans use "Ümlauts" and pay in €uro
-
-
-
-See also [escaping smarty parsing](#language.escaping), [escape
-modifier](#language.modifier.escape).
+See also [escaping smarty parsing](../language-basic-syntax/language-escaping.md), [escape
+modifier](language-modifier-escape.md).
diff --git a/docs/designers/language-modifiers/language-modifier-upper.md b/docs/designers/language-modifiers/language-modifier-upper.md
index adcae0fa..3173059c 100644
--- a/docs/designers/language-modifiers/language-modifier-upper.md
+++ b/docs/designers/language-modifiers/language-modifier-upper.md
@@ -1,31 +1,33 @@
-upper {#language.modifier.upper}
-=====
+# upper
This is used to uppercase a variable. This is equivalent to the PHP
[`strtoupper()`](https://www.php.net/strtoupper) function.
+## Basic usage
+```smarty
+{$myVar|upper}
+```
- assign('articleTitle', "If Strike isn't Settled Quickly it may Last a While.");
- ?>
+## Examples
-
+```php
+assign('articleTitle', "If Strike isn't Settled Quickly it may Last a While.");
+```
Where template is:
-
- {$articleTitle}
- {$articleTitle|upper}
-
-
+```smarty
+{$articleTitle}
+{$articleTitle|upper}
+```
Will output:
+```
+If Strike isn't Settled Quickly it may Last a While.
+IF STRIKE ISN'T SETTLED QUICKLY IT MAY LAST A WHILE.
+```
- If Strike isn't Settled Quickly it may Last a While.
- IF STRIKE ISN'T SETTLED QUICKLY IT MAY LAST A WHILE.
-
-
-
-See also [`lower`](#language.modifier.lower) and
-[`capitalize`](#language.modifier.capitalize).
+See also [`lower`](lower) and
+[`capitalize`](language-modifier-capitalize.md).
diff --git a/docs/designers/language-modifiers/language-modifier-wordwrap.md b/docs/designers/language-modifiers/language-modifier-wordwrap.md
index 49acd696..f3348fd7 100644
--- a/docs/designers/language-modifiers/language-modifier-wordwrap.md
+++ b/docs/designers/language-modifiers/language-modifier-wordwrap.md
@@ -1,5 +1,4 @@
-wordwrap {#language.modifier.wordwrap}
-========
+# wordwrap
Wraps a string to a column width, the default is 80. As an optional
second parameter, you can specify a string of text to wrap the text to
@@ -9,61 +8,66 @@ off at the exact character length, pass the optional third parameter as
TRUE. This is equivalent to the PHP
[`wordwrap()`](https://www.php.net/wordwrap) function.
- Parameter Position Type Required Default Description
- -------------------- --------- ---------- --------- ------------------------------------------------------------------------------------------------------
- 1 integer No 80 This determines how many columns to wrap to.
- 2 string No \\n This is the string used to wrap words with.
- 3 boolean No FALSE This determines whether or not to wrap at a word boundary (FALSE), or at the exact character (TRUE).
+## Basic usage
+```smarty
+{$myVar|wordwrap:30}
+```
+## Parameters
- assign('articleTitle',
- "Blind woman gets new kidney from dad she hasn't seen in years."
- );
+## Examples
- ?>
+```php
+assign('articleTitle',
+ "Blind woman gets new kidney from dad she hasn't seen in years."
+ );
+
+```
Where template is
+```smarty
+{$articleTitle}
- {$articleTitle}
+{$articleTitle|wordwrap:30}
- {$articleTitle|wordwrap:30}
+{$articleTitle|wordwrap:20}
- {$articleTitle|wordwrap:20}
+{$articleTitle|wordwrap:30:" \n"}
- {$articleTitle|wordwrap:30:" \n"}
-
- {$articleTitle|wordwrap:26:"\n":true}
-
-
+{$articleTitle|wordwrap:26:"\n":true}
+```
Will output:
+```html
+Blind woman gets new kidney from dad she hasn't seen in years.
- Blind woman gets new kidney from dad she hasn't seen in years.
+Blind woman gets new kidney
+from dad she hasn't seen in
+years.
- Blind woman gets new kidney
- from dad she hasn't seen in
- years.
+Blind woman gets new
+kidney from dad she
+hasn't seen in
+years.
- Blind woman gets new
- kidney from dad she
- hasn't seen in
- years.
+Blind woman gets new kidney
+from dad she hasn't seen in
+years.
- Blind woman gets new kidney
- from dad she hasn't seen in
- years.
+Blind woman gets new kidn
+ey from dad she hasn't se
+en in years.
+```
- Blind woman gets new kidn
- ey from dad she hasn't se
- en in years.
-
-
-
-See also [`nl2br`](#language.modifier.nl2br) and
-[`{textformat}`](#language.function.textformat).
+See also [`nl2br`](language-modifier-nl2br.md) and
+[`{textformat}`](../language-custom-functions/language-function-textformat.md).
diff --git a/docs/designers/language-variables.md b/docs/designers/language-variables.md
deleted file mode 100644
index 04abda43..00000000
--- a/docs/designers/language-variables.md
+++ /dev/null
@@ -1,33 +0,0 @@
-# Variables
-
-Smarty has several types of variables. The type of the
-variable depends on what symbol it is prefixed or enclosed within.
-
-- [Variables assigned from PHP](./language-variables/language-assigned-variables.md)
-- [Variable scopes](./language-variables/language-variable-scopes.md)
-- [Variables loaded from config files](./language-variables/language-config-variables.md)
-- [{$smarty} reserved variable](./language-variables/language-variables-smarty.md)
-
-Variables in Smarty can be either displayed directly or used as
-arguments for [functions](./language-basic-syntax/language-syntax-functions.md),
-[attributes](./language-basic-syntax/language-syntax-attributes.md) and
-[modifiers](./language-modifiers.md), inside conditional expressions, etc.
-To print a variable, simply enclose it in the
-[delimiters](../programmers/api-variables/variable-left-delimiter.md) so that it is the only thing
-contained between them.
-
-```smarty
-{$Name}
-
-{$product.part_no} {$product.description}
-
-{$Contacts[row].Phone}
-
-
-```
-
-> **Note**
->
-> An easy way to examine assigned Smarty variables is with the
-> [debugging console](./chapter-debugging-console.md).
-
diff --git a/docs/designers/language-variables/index.md b/docs/designers/language-variables/index.md
new file mode 100644
index 00000000..58ae6eb9
--- /dev/null
+++ b/docs/designers/language-variables/index.md
@@ -0,0 +1,36 @@
+# Variables
+
+Smarty has several types of variables. The type of the
+variable depends on what symbol it is prefixed or enclosed within.
+
+- [Variables assigned from PHP](language-assigned-variables.md)
+- [Variables loaded from config files](language-config-variables.md)
+- [{$smarty} reserved variable](language-variables-smarty.md)
+
+Variables in Smarty can be either displayed directly or used as
+arguments for [functions](../language-basic-syntax/language-syntax-functions.md),
+[attributes](../language-basic-syntax/language-syntax-attributes.md) and
+[modifiers](../language-modifiers/index.md), inside conditional expressions, etc.
+To print a variable, simply enclose it in the
+[delimiters](../../programmers/api-variables/variable-left-delimiter.md) so that it is the only thing
+contained between them.
+
+```smarty
+{$Name}
+
+{$product.part_no} {$product.description}
+
+{$Contacts[row].Phone}
+
+
+```
+
+## Scopes
+You can assign variables to specific [variable scopes](language-variable-scopes.md).
+
+
+> **Note**
+>
+> An easy way to examine assigned Smarty variables is with the
+> [debugging console](../chapter-debugging-console.md).
+
diff --git a/docs/designers/language-variables/language-assigned-variables.md b/docs/designers/language-variables/language-assigned-variables.md
index 005dea4a..bd356a2b 100644
--- a/docs/designers/language-variables/language-assigned-variables.md
+++ b/docs/designers/language-variables/language-assigned-variables.md
@@ -1,142 +1,126 @@
-Variables assigned from PHP {#language.assigned.variables}
-===========================
+# Variables assigned from PHP
-Assigned variables that are referenced by preceding them with a dollar
+Variables assigned from PHP are referenced by preceding them with a dollar
(`$`) sign.
-PHP code
+## Examples
+```php
+assign('firstname', 'Doug');
+$smarty->assign('lastname', 'Evans');
+$smarty->assign('meetingPlace', 'New York');
- $smarty->assign('firstname', 'Doug');
- $smarty->assign('lastname', 'Evans');
- $smarty->assign('meetingPlace', 'New York');
+$smarty->display('index.tpl');
- $smarty->display('index.tpl');
-
- ?>
+```
`index.tpl` source:
-
- Hello {$firstname} {$lastname}, glad to see you can make it.
-
- {* this will not work as $variables are case sensitive *}
- This weeks meeting is in {$meetingplace}.
- {* this will work *}
- This weeks meeting is in {$meetingPlace}.
-
+```smarty
+Hello {$firstname} {$lastname}, glad to see you can make it.
+
+{* this will not work as $variables are case sensitive *}
+This weeks meeting is in {$meetingplace}.
+{* this will work *}
+This weeks meeting is in {$meetingPlace}.
+```
-
This above would output:
-
- Hello Doug Evans, glad to see you can make it.
-
- This weeks meeting is in .
- This weeks meeting is in New York.
-
+```html
+Hello Doug Evans, glad to see you can make it.
+
+This weeks meeting is in .
+This weeks meeting is in New York.
+```
-
-Associative arrays {#language.variables.assoc.arrays}
-------------------
+## Associative arrays
You can also reference associative array variables by specifying the key
-after a dot \".\" symbol.
+after a dot "." symbol.
-
- assign('Contacts',
- array('fax' => '555-222-9876',
- 'email' => 'zaphod@slartibartfast.example.com',
- 'phone' => array('home' => '555-444-3333',
- 'cell' => '555-111-1234')
- )
- );
- $smarty->display('index.tpl');
- ?>
-
-
+```php
+assign('Contacts',
+ array('fax' => '555-222-9876',
+ 'email' => 'zaphod@slartibartfast.example.com',
+ 'phone' => array('home' => '555-444-3333',
+ 'cell' => '555-111-1234')
+ )
+ );
+$smarty->display('index.tpl');
+```
`index.tpl` source:
-
- {$Contacts.fax}
- {$Contacts.email}
- {* you can print arrays of arrays as well *}
- {$Contacts.phone.home}
- {$Contacts.phone.cell}
-
-
+```smarty
+{$Contacts.fax}
+{$Contacts.email}
+{* you can print arrays of arrays as well *}
+{$Contacts.phone.home}
+{$Contacts.phone.cell}
+```
this will output:
+```html
+555-222-9876
+zaphod@slartibartfast.example.com
+555-444-3333
+555-111-1234
+```
- 555-222-9876
- zaphod@slartibartfast.example.com
- 555-444-3333
- 555-111-1234
-
-
-
-Array indexes {#language.variables.array.indexes}
--------------
+## Array indexes
You can reference arrays by their index, much like native PHP syntax.
-
- assign('Contacts', array(
- '555-222-9876',
- 'zaphod@slartibartfast.example.com',
- array('555-444-3333',
- '555-111-1234')
- ));
- $smarty->display('index.tpl');
- ?>
-
-
+```php
+assign('Contacts', array(
+ '555-222-9876',
+ 'zaphod@slartibartfast.example.com',
+ array('555-444-3333',
+ '555-111-1234')
+ ));
+$smarty->display('index.tpl');
+```
`index.tpl` source:
-
- {$Contacts[0]}
- {$Contacts[1]}
- {* you can print arrays of arrays as well *}
- {$Contacts[2][0]}
- {$Contacts[2][1]}
-
-
+```smarty
+{$Contacts[0]}
+{$Contacts[1]}
+{* you can print arrays of arrays as well *}
+{$Contacts[2][0]}
+{$Contacts[2][1]}
+```
This will output:
+```html
+555-222-9876
+zaphod@slartibartfast.example.com
+555-444-3333
+555-111-1234
+```
- 555-222-9876
- zaphod@slartibartfast.example.com
- 555-444-3333
- 555-111-1234
+## Objects
-
-
-Objects {#language.variables.objects}
--------
-
-Properties of [objects](#advanced.features.objects) assigned from PHP
+Properties of [objects](../../programmers/advanced-features/advanced-features-objects.md) assigned from PHP
can be referenced by specifying the property name after the `->` symbol.
-
- name: {$person->name}
- email: {$person->email}
-
-
+```smarty
+name: {$person->name}
+email: {$person->email}
+```
this will output:
-
- name: Zaphod Beeblebrox
- email: zaphod@slartibartfast.example.com
-
-
+```html
+name: Zaphod Beeblebrox
+email: zaphod@slartibartfast.example.com
+```
\ No newline at end of file
diff --git a/docs/designers/language-variables/language-config-variables.md b/docs/designers/language-variables/language-config-variables.md
index a3683d99..89a90ce1 100644
--- a/docs/designers/language-variables/language-config-variables.md
+++ b/docs/designers/language-variables/language-config-variables.md
@@ -1,83 +1,79 @@
-Variables loaded from config files {#language.config.variables}
-==================================
+# Variables loaded from config files
-Variables that are loaded from the [config files](#config.files) are
+Variables that are loaded from the [config files](../config-files.md) are
referenced by enclosing them within `#hash_marks#`, or with the smarty
-variable [`$smarty.config`](#language.variables.smarty.config). The
+variable [`$smarty.config`](language-variables-smarty.md#smartyconfig-languagevariablessmartyconfig). The
later syntax is useful for embedding into quoted attribute values, or
-accessing variable values such as \$smarty.config.\$foo.
+accessing variable values such as `$smarty.config.$foo`.
+
+## Examples
Example config file - `foo.conf`:
-
-
- pageTitle = "This is mine"
- bodyBgColor = '#eeeeee'
- tableBorderSize = 3
- tableBgColor = "#bbbbbb"
- rowBgColor = "#cccccc"
-
-
+```ini
+pageTitle = "This is mine"
+bodyBgColor = '#eeeeee'
+tableBorderSize = 3
+tableBgColor = "#bbbbbb"
+rowBgColor = "#cccccc"
+```
A template demonstrating the `#hash#` method:
-
- {config_load file='foo.conf'}
-
+```smarty
+{config_load file='foo.conf'}
+
{#pageTitle#}
-
-
- First |
- Last |
- Address |
-
-
+
+
+ First |
+ Last |
+ Address |
+
+
-
-
+
+```
-
A template demonstrating the
-[`$smarty.config`](#language.variables.smarty.config) method:
+[`$smarty.config`](language-variables-smarty.md#smartyconfig-languagevariablessmartyconfig) method:
-
- {config_load file='foo.conf'}
-
- {$smarty.config.pageTitle}
+```smarty
+{config_load file='foo.conf'}
+
+{$smarty.config.pageTitle}
-
-
- First |
- Last |
- Address |
-
-
+
+
+ First |
+ Last |
+ Address |
+
+
-
-
-
+
+```
Both examples would output:
-
-
+```html
+
This is mine
-
-
- First |
- Last |
- Address |
-
-
+
+
+ First |
+ Last |
+ Address |
+
+
-
-
-
+
+```
Config file variables cannot be used until after they are loaded in from
a config file. This procedure is explained later in this document under
-[`{config_load}`](#language.function.config.load).
+[`{config_load}`](../language-builtin-functions/language-function-config-load.md).
-See also [variables](#language.syntax.variables) and [\$smarty reserved
-variables](#language.variables.smarty)
+See also [variables](../language-basic-syntax/language-syntax-variables.md) and [$smarty reserved
+variables](language-variables-smarty.md).
diff --git a/docs/designers/language-variables/language-variable-scopes.md b/docs/designers/language-variables/language-variable-scopes.md
index 2ba3f026..e2b24466 100644
--- a/docs/designers/language-variables/language-variable-scopes.md
+++ b/docs/designers/language-variables/language-variable-scopes.md
@@ -1,61 +1,60 @@
-Variable scopes {#language.variable.scopes}
-===============
+# Variable scopes
You have the choice to assign variables to the scope of the main Smarty
-object, data objects created with [`createData()`](#api.create.data),
+object, data objects created with [`createData()`](../../programmers/api-functions/api-create-data.md),
and template objects created with
-[`createTemplate()`](#api.create.template). These objects can be
+[`createTemplate()`](../../programmers/api-functions/api-create-template.md). These objects can be
chained. A template sees all the variables of its own object and all
variables assigned to the objects in its chain of parent objects.
-By default templates which are rendered by
-[`$smarty->display(...)`](#api.display) or
-[`$smarty->fetch(...)`](#api.fetch) calls are automatically linked to
+By default, templates which are rendered by
+[`$smarty->display(...)`](../../programmers/api-functions/api-display.md) or
+[`$smarty->fetch(...)`](../../programmers/api-functions/api-fetch.md) calls are automatically linked to
the Smarty object variable scope.
By assigning variables to individual data or template objects you have
full control which variables can be seen by a template.
+```php
+assign('foo','smarty');
+// assign variables to data object scope
+$data = $smarty->createData();
+$data->assign('foo','data');
+$data->assign('bar','bar-data');
- // assign variable to Smarty object scope
- $smarty->assign('foo','smarty');
+// assign variables to other data object scope
+$data2 = $smarty->createData($data);
+$data2->assign('bar','bar-data2');
- // assign variables to data object scope
- $data = $smarty->createData();
- $data->assign('foo','data');
- $data->assign('bar','bar-data');
+// assign variable to template object scope
+$tpl = $smarty->createTemplate('index.tpl');
+$tpl->assign('bar','bar-template');
- // assign variables to other data object scope
- $data2 = $smarty->createData($data);
- $data2->assign('bar','bar-data2');
+// assign variable to template object scope with link to Smarty object
+$tpl2 = $smarty->createTemplate('index.tpl',$smarty);
+$tpl2->assign('bar','bar-template2');
- // assign variable to template object scope
- $tpl = $smarty->createTemplate('index.tpl');
- $tpl->assign('bar','bar-template');
+// This display() does see $foo='smarty' from the $smarty object
+$smarty->display('index.tpl');
- // assign variable to template object scope with link to Smarty object
- $tpl2 = $smarty->createTemplate('index.tpl',$smarty);
- $tpl2->assign('bar','bar-template2');
+// This display() does see $foo='data' and $bar='bar-data' from the data object $data
+$smarty->display('index.tpl',$data);
- // This display() does see $foo='smarty' from the $smarty object
- $smarty->display('index.tpl');
+// This display() does see $foo='data' from the data object $data
+// and $bar='bar-data2' from the data object $data2
+$smarty->display('index.tpl',$data2);
- // This display() does see $foo='data' and $bar='bar-data' from the data object $data
- $smarty->display('index.tpl',$data);
+// This display() does see $bar='bar-template' from the template object $tpl
+$tpl->display(); // or $smarty->display($tpl);
- // This display() does see $foo='data' from the data object $data
- // and $bar='bar-data2' from the data object $data2
- $smarty->display('index.tpl',$data2);
+// This display() does see $bar='bar-template2' from the template object $tpl2
+// and $foo='smarty' form the Smarty object $foo
+$tpl2->display(); // or $smarty->display($tpl2);
+```
- // This display() does see $bar='bar-template' from the template object $tpl
- $tpl->display(); // or $smarty->display($tpl);
-
- // This display() does see $bar='bar-template2' from the template object $tpl2
- // and $foo='smarty' form the Smarty object $foo
- $tpl2->display(); // or $smarty->display($tpl2);
-
-
-
-See also [`assign()`](#api.assign), [`createData()`](#api.create.data)
-and [`createTemplate()`](#api.create.template).
+See also [`assign()`](../../programmers/api-functions/api-assign.md),
+[`createData()`](../../programmers/api-functions/api-create-data.md)
+and [`createTemplate()`](../../programmers/api-functions/api-create-template.md).
diff --git a/docs/designers/language-variables/language-variables-smarty.md b/docs/designers/language-variables/language-variables-smarty.md
index 2d20b239..da543fb6 100644
--- a/docs/designers/language-variables/language-variables-smarty.md
+++ b/docs/designers/language-variables/language-variables-smarty.md
@@ -1,43 +1,40 @@
-{\$smarty} reserved variable {#language.variables.smarty}
-============================
+# {$smarty} reserved variable
The PHP reserved `{$smarty}` variable can be used to access several
environment and request variables. The full list of them follows.
-Request variables {#language.variables.smarty.request}
------------------
+## Request variables
The [request variables](https://www.php.net/reserved.variables) such as
`$_GET`, `$_POST`, `$_COOKIE`, `$_SERVER`, `$_ENV` and `$_SESSION` can
be accessed as demonstrated in the examples below:
+```smarty
+{* display value of page from URL ($_GET) http://www.example.com/index.php?page=foo *}
+{$smarty.get.page}
- {* display value of page from URL ($_GET) http://www.example.com/index.php?page=foo *}
- {$smarty.get.page}
+{* display the variable "page" from a form ($_POST['page']) *}
+{$smarty.post.page}
- {* display the variable "page" from a form ($_POST['page']) *}
- {$smarty.post.page}
+{* display the value of the cookie "username" ($_COOKIE['username']) *}
+{$smarty.cookies.username}
- {* display the value of the cookie "username" ($_COOKIE['username']) *}
- {$smarty.cookies.username}
+{* display the server variable "SERVER_NAME" ($_SERVER['SERVER_NAME'])*}
+{$smarty.server.SERVER_NAME}
- {* display the server variable "SERVER_NAME" ($_SERVER['SERVER_NAME'])*}
- {$smarty.server.SERVER_NAME}
+{* display the system environment variable "PATH" *}
+{$smarty.env.PATH}
- {* display the system environment variable "PATH" *}
- {$smarty.env.PATH}
+{* display the php session variable "id" ($_SESSION['id']) *}
+{$smarty.session.id}
- {* display the php session variable "id" ($_SESSION['id']) *}
- {$smarty.session.id}
-
- {* display the variable "username" from merged get/post/cookies/server/env *}
- {$smarty.request.username}
-
-
+{* display the variable "username" from merged get/post/cookies/server/env *}
+{$smarty.request.username}
+```
> **Note**
>
-> For historical reasons `{$SCRIPT_NAME}` is short-hand for
+> For historical reasons `{$SCRIPT_NAME}` is shorthand for
> `{$smarty.server.SCRIPT_NAME}`.
>
>
@@ -51,46 +48,38 @@ be accessed as demonstrated in the examples below:
> globals mixes underlying application code structure with templates. A
> good practice is to assign specific needed values to template vars.
-{\$smarty.now} {#language.variables.smarty.now}
---------------
+## {$smarty.now}
The current [timestamp](https://www.php.net/function.time) can be accessed
with `{$smarty.now}`. The value reflects the number of seconds passed
since the so-called Epoch on January 1, 1970, and can be passed directly
-to the [`date_format`](#language.modifier.date.format) modifier for
+to the [`date_format`](../language-modifiers/language-modifier-date-format.md) modifier for
display. Note that [`time()`](https://www.php.net/function.time) is called
on each invocation; eg a script that takes three seconds to execute with
-a call to `$smarty.now` at start and end will show the three second
+a call to `$smarty.now` at start and end will show the three-second
difference.
-::: {.informalexample}
+```smarty
+{* use the date_format modifier to show current date and time *}
+{$smarty.now|date_format:'%Y-%m-%d %H:%M:%S'}
+```
- {* use the date_format modifier to show current date and time *}
- {$smarty.now|date_format:'%Y-%m-%d %H:%M:%S'}
-
-
-:::
-
-{\$smarty.const} {#language.variables.smarty.const}
-----------------
+## {$smarty.const}
You can access PHP constant values directly. See also [smarty
-constants](#smarty.constants).
+constants](../../programmers/smarty-constants.md).
-::: {.informalexample}
-
-
-:::
+```php
+ **Note**
>
@@ -99,78 +88,69 @@ Output the constant in a template with
> application code structure into the templates. A good practice is to
> assign specific needed values to template vars.
-{\$smarty.capture} {#language.variables.smarty.capture}
-------------------
+## {$smarty.capture}
Template output captured via the built-in
-[`{capture}..{/capture}`](#language.function.capture) function can be
+[`{capture}..{/capture}`](../language-builtin-functions/language-function-capture.md) function can be
accessed using the `{$smarty.capture}` variable. See the
-[`{capture}`](#language.function.capture) page for more information.
+[`{capture}`](../language-builtin-functions/language-function-capture.md) page for more information.
-{\$smarty.config} {#language.variables.smarty.config}
------------------
+## {$smarty.config}
`{$smarty.config}` variable can be used to refer to loaded [config
-variables](#language.config.variables). `{$smarty.config.foo}` is a
+variables](language-config-variables.md). `{$smarty.config.foo}` is a
synonym for `{#foo#}`. See the
-[{config\_load}](#language.function.config.load) page for more info.
+[{config_load}](../language-builtin-functions/language-function-config-load.md) page for more info.
-{\$smarty.section} {#language.variables.smarty.loops}
-------------------
+## {$smarty.section}
The `{$smarty.section}` variables can be used to refer to
-[`{section}`](#language.function.section) loop properties. These have
+[`{section}`](../language-builtin-functions/language-function-section.md) loop properties. These have
some very useful values such as `.first`, `.index`, etc.
> **Note**
>
> The `{$smarty.foreach}` variable is no longer used with the new
-> [`{foreach}`](#language.function.foreach) syntax, but is still
+> [`{foreach}`](../language-builtin-functions/language-function-foreach.md) syntax, but is still
> supported with Smarty 2.x style foreach syntax.
-{\$smarty.template} {#language.variables.smarty.template}
--------------------
+## {$smarty.template}
Returns the name of the current template being processed (without the
directory).
-{\$smarty.template\_object} {#language.variables.smarty.template_object}
----------------------------
+## {$smarty.template_object}
Returns the template object of the current template being processed.
-{\$smarty.current\_dir} {#language.variables.smarty.current_dir}
------------------------
+## {$smarty.current_dir}
Returns the name of the directory for the current template being
-processed.
+processed if it is loaded from the filesystem (the default).
-{\$smarty.version} {#language.variables.smarty.version}
-------------------
+## {$smarty.version}
Returns the version of Smarty the template was compiled with.
+```smarty
+
+```
-
-
-{\$smarty.block.child} {#language.variables.smarty.block.child}
-----------------------
+## {$smarty.block.child}
Returns block text from child template. See [Template
-inheritance](#advanced.features.template.inheritance).
+inheritance](../../programmers/advanced-features/advanced-features-template-inheritance.md).
-{\$smarty.block.parent} {#language.variables.smarty.block.parent}
------------------------
+## {$smarty.block.parent}
Returns block text from parent template. See [Template
-inheritance](#advanced.features.template.inheritance)
+inheritance](../../programmers/advanced-features/advanced-features-template-inheritance.md)
-{\$smarty.ldelim}, {\$smarty.rdelim} {#language.variables.smarty.ldelim}
-------------------------------------
+## {$smarty.ldelim}, {$smarty.rdelim}
These variables are used for printing the left-delimiter and
right-delimiter value literally, the same as
-[`{ldelim},{rdelim}`](#language.function.ldelim).
+[`{ldelim},{rdelim}`](../language-builtin-functions/language-function-ldelim.md).
-See also [assigned variables](#language.assigned.variables) and [config
-variables](#language.config.variables)
+See also [assigned variables](language-assigned-variables.md) and [config
+variables](language-config-variables.md)
diff --git a/docs/index.md b/docs/index.md
index 1e44e90c..39b9f1a5 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -26,12 +26,12 @@ and 480 for $height, the result is:
- [Getting Started](./getting-started.md)
## Smarty for template designers
-- [Basic Syntax](designers/language-basic-syntax/language-basic-syntax.md)
-- [Variables](./designers/language-variables.md)
-- [Variable Modifiers](./designers/language-modifiers.md)
+- [Basic Syntax](designers/language-basic-syntax/index.md)
+- [Variables](designers/language-variables/index.md)
+- [Variable Modifiers](designers/language-modifiers/index.md)
- [Combining Modifiers](./designers/language-combining-modifiers.md)
-- [Built-in Functions](designers/language-builtin-functions/language-builtin-functions.md)
-- [Custom Functions](./designers/language-custom-functions.md)
+- [Built-in Functions](designers/language-builtin-functions/index.md)
+- [Custom Functions](designers/language-custom-functions/index.md)
- [Config Files](./designers/config-files.md)
- [Debugging Console](./designers/chapter-debugging-console.md)
diff --git a/docs/programmers/api-variables/variable-auto-literal.md b/docs/programmers/api-variables/variable-auto-literal.md
index e5ddb34f..8d068502 100644
--- a/docs/programmers/api-variables/variable-auto-literal.md
+++ b/docs/programmers/api-variables/variable-auto-literal.md
@@ -14,4 +14,4 @@ auto\_literal to false.
:::
-See also [Escaping Smarty Parsing](#language.escaping),
+See also [Escaping Smarty parsing](#language.escaping),
diff --git a/mkdocs.yml b/mkdocs.yml
index 50af4210..7762cd75 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -36,9 +36,39 @@ nav:
- Attributes: 'designers/language-basic-syntax/language-syntax-attributes.md'
- Quotes: 'designers/language-basic-syntax/language-syntax-quotes.md'
- Math: 'designers/language-basic-syntax/language-math.md'
- - 'Escaping Smarty Parsing': 'designers/language-basic-syntax/language-escaping.md'
- - 'designers/language-variables.md'
- - 'designers/language-modifiers.md'
+ - 'Escaping Smarty parsing': 'designers/language-basic-syntax/language-escaping.md'
+ - 'Variables':
+ - 'Introduction': 'designers/language-variables/index.md'
+ - 'Assigned from PHP': 'designers/language-variables/language-assigned-variables.md'
+ - 'Variable scopes': 'designers/language-variables/language-variable-scopes.md'
+ - 'From config files': 'designers/language-variables/language-config-variables.md'
+ - '{$smarty}': 'designers/language-variables/language-variables-smarty.md'
+ - 'Modifiers':
+ - 'Introduction': 'designers/language-modifiers/index.md'
+ - 'capitalize': 'designers/language-modifiers/language-modifier-capitalize.md'
+ - 'cat': 'designers/language-modifiers/language-modifier-cat.md'
+ - 'count_characters': 'designers/language-modifiers/language-modifier-count-characters.md'
+ - 'count_paragraphs': 'designers/language-modifiers/language-modifier-count-paragraphs.md'
+ - 'count_sentences': 'designers/language-modifiers/language-modifier-count-sentences.md'
+ - 'count_words': 'designers/language-modifiers/language-modifier-count-words.md'
+ - 'date_format': 'designers/language-modifiers/language-modifier-date-format.md'
+ - 'default': 'designers/language-modifiers/language-modifier-default.md'
+ - 'escape': 'designers/language-modifiers/language-modifier-escape.md'
+ - 'from_charset': 'designers/language-modifiers/language-modifier-from-charset.md'
+ - 'indent': 'designers/language-modifiers/language-modifier-indent.md'
+ - 'lower': 'designers/language-modifiers/language-modifier-lower.md'
+ - 'nl2br': 'designers/language-modifiers/language-modifier-nl2br.md'
+ - 'regex_replace': 'designers/language-modifiers/language-modifier-regex-replace.md'
+ - 'replace': 'designers/language-modifiers/language-modifier-replace.md'
+ - 'spacify': 'designers/language-modifiers/language-modifier-spacify.md'
+ - 'string_format': 'designers/language-modifiers/language-modifier-string-format.md'
+ - 'strip': 'designers/language-modifiers/language-modifier-strip.md'
+ - 'strip_tags': 'designers/language-modifiers/language-modifier-strip-tags.md'
+ - 'to_charset': 'designers/language-modifiers/language-modifier-to-charset.md'
+ - 'truncate': 'designers/language-modifiers/language-modifier-truncate.md'
+ - 'unescape': 'designers/language-modifiers/language-modifier-unescape.md'
+ - 'upper': 'designers/language-modifiers/language-modifier-upper.md'
+ - 'wordwrap': 'designers/language-modifiers/language-modifier-wordwrap.md'
- 'designers/language-combining-modifiers.md'
- 'Builtin Functions':
- 'Introduction': 'designers/language-builtin-functions/index.md'
@@ -63,7 +93,23 @@ nav:
- '{setfilter}': 'designers/language-builtin-functions/language-function-setfilter.md'
- '{strip}': 'designers/language-builtin-functions/language-function-strip.md'
- '{while}': 'designers/language-builtin-functions/language-function-while.md'
- - 'designers/language-custom-functions.md'
+ - 'Custom Functions':
+ - 'Introduction': 'designers/language-custom-functions/index.md'
+ - '{counter}': 'designers/language-custom-functions/language-function-counter.md'
+ - '{cycle}': 'designers/language-custom-functions/language-function-cycle.md'
+ - '{debug}': 'designers/language-custom-functions/language-function-debug.md'
+ - '{eval}': 'designers/language-custom-functions/language-function-eval.md'
+ - '{fetch}': 'designers/language-custom-functions/language-function-fetch.md'
+ - '{html_checkboxes}': 'designers/language-custom-functions/language-function-html-checkboxes.md'
+ - '{html_image}': 'designers/language-custom-functions/language-function-html-image.md'
+ - '{html_options}': 'designers/language-custom-functions/language-function-html-options.md'
+ - '{html_radios}': 'designers/language-custom-functions/language-function-html-radios.md'
+ - '{html_select_date}': 'designers/language-custom-functions/language-function-html-select-date.md'
+ - '{html_select_time}': 'designers/language-custom-functions/language-function-html-select-time.md'
+ - '{html_table}': 'designers/language-custom-functions/language-function-html-table.md'
+ - '{mailto}': 'designers/language-custom-functions/language-function-mailto.md'
+ - '{math}': 'designers/language-custom-functions/language-function-math.md'
+ - '{textformat}': 'designers/language-custom-functions/language-function-textformat.md'
- 'designers/config-files.md'
- 'designers/chapter-debugging-console.md'
- 'Programmers':
| |