aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/smarty/smarty/docs/designers/language-basic-syntax/language-syntax-attributes.md
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/smarty/smarty/docs/designers/language-basic-syntax/language-syntax-attributes.md')
-rw-r--r--vendor/smarty/smarty/docs/designers/language-basic-syntax/language-syntax-attributes.md39
1 files changed, 19 insertions, 20 deletions
diff --git a/vendor/smarty/smarty/docs/designers/language-basic-syntax/language-syntax-attributes.md b/vendor/smarty/smarty/docs/designers/language-basic-syntax/language-syntax-attributes.md
index 417ac9727..41f6c458d 100644
--- a/vendor/smarty/smarty/docs/designers/language-basic-syntax/language-syntax-attributes.md
+++ b/vendor/smarty/smarty/docs/designers/language-basic-syntax/language-syntax-attributes.md
@@ -1,7 +1,6 @@
-Attributes {#language.syntax.attributes}
-==========
+# Attributes
-Most of the [functions](#language.syntax.functions) take attributes that
+Most of the [functions](./language-syntax-functions.md) take attributes that
specify or modify their behavior. Attributes to Smarty functions are
much like HTML attributes. Static values don't have to be enclosed in
quotes, but it is required for literal strings. Variables with or
@@ -12,35 +11,35 @@ Some attributes require boolean values (TRUE or FALSE). These can be
specified as `true` and `false`. If an attribute has no value assigned
it gets the default boolean value of true.
+## Examples
+```smarty
+{include file="header.tpl"}
- {include file="header.tpl"}
+{include file="header.tpl" nocache} // is equivalent to nocache=true
- {include file="header.tpl" nocache} // is equivalent to nocache=true
+{include file="header.tpl" attrib_name="attrib value"}
- {include file="header.tpl" attrib_name="attrib value"}
+{include file=$includeFile}
- {include file=$includeFile}
+{include file=#includeFile# title="My Title"}
- {include file=#includeFile# title="My Title"}
+{assign var=foo value={counter}} // plugin result
- {assign var=foo value={counter}} // plugin result
+{assign var=foo value=substr($bar,2,5)} // PHP function result
- {assign var=foo value=substr($bar,2,5)} // PHP function result
+{assign var=foo value=$bar|strlen} // using modifier
- {assign var=foo value=$bar|strlen} // using modifier
+{assign var=foo value=$buh+$bar|strlen} // more complex expression
- {assign var=foo value=$buh+$bar|strlen} // more complex expression
+{html_select_date display_days=true}
- {html_select_date display_days=true}
-
- {mailto address="smarty@example.com"}
-
- <select name="company_id">
- {html_options options=$companies selected=$company_id}
- </select>
+{mailto address="smarty@example.com"}
+<select name="company_id">
+ {html_options options=$companies selected=$company_id}
+</select>
+```
-
> **Note**
>
> Although Smarty can handle some very complex expressions and syntax,