Template:Evaldemo
From Joomla! Documentation
{{ {{{1}}}}} gives {{{{{1}}}}}
This documentation is transcluded from Template:Evaldemo/doc.
To discuss this template as a whole, please see JDOC:WTP. If you wish to discuss general wordings, rather than the wording or formatting of this specific template, don't post here, or else what you say will probably go unnoticed.
Examples
- {{evaldemo|CURRENTDAY|s=is}} displays
- {{
CURRENTDAY}} is 13
- {{
- {{evaldemo|#expr:2*3}} displays
- {{
#expr:2*3}} gives 6
- {{
- {{subst:evaldemo|subst=subst:|#expr:2*3}} gives:
- {{
subst:#expr:2*3}} gives 6
- {{
- {{evaldemo|1=#expr:2+2=5}} displays
- {{
#expr:2+2=5}} gives 0
- {{
- {{evaldemo|1=#expr:(2+2=4)|s==}} displays
- {{
#expr:(2+2=4)}} = 1
- {{
- {{evaldemo|urlencode:!|s==}} displays
- {{
urlencode:!}} = %21
- {{
- {{evaldemo|uc:abc}} gives
- {{
uc:abc}} gives ABC
- {{
- {{subst:evaldemo|uc:Upper Case|subst=subst:}} substitutes
- {{
subst:uc:Upper Case}} gives UPPER CASE - See Help:Substitution for several caveats wrt subst=subst:.
- {{
As always the expression (first parameter) cannot directly contain "|", "=", plus other special cases related to square brackets / curly braces. In the case of this template "not directly" means "never" except from "=" as shown above.
For simple nested expressions use Template:Evdn :
- {{evdn|#expr:4*|#expr:not 0| >3 | s=yields}} displays
- {{
#expr: 4*{{#expr:not 0}}>3}} yields 1
- {{
- {{evdn|urlencode:|DIRMARK}} displays
- {{
urlencode:{{DIRMARK}}}} gives %E2%80%8E
- {{