W3TPL/tag/get: Difference between revisions

From Woozle Writes Code
< W3TPL‎ | tag
Jump to navigation Jump to search
m (sysvar -> sysdata)
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
==About==
==About==
* '''Action''': Tag is replaced by the value of a variable or expression.
* '''Action''': Tag is replaced by the value of a variable or expression.
* '''Options''':
 
** '''arg''': get value from [[http request]] named ''name'' instead of using stored variable
This tag has many operations in common with {{l/w3tpl/tag|let}}; a comparison is [[../get-let|here]].
*** Retrieves value from $wgRequest->getVal(''name'', ''default'')
==Options==
*** This is somewhat obsolete; it is better to use the [[W3TPL/sysdata|sysdata]] syntax
===unverified===
** '''codes''': process with ShowHTML() before output
Support for these options has not been confirmed as of 2022-04-20.
** '''default'''= default value to use if argument named ''arg'' is not set
* '''arg''': get value from the http request argument named ''name'', instead of using a stored variable
*** This may eventually be used to fill in a value in other cases, but for now it doesn't.
** Retrieves value from <code>$wgRequest->getVal(''name'', ''default'')</code>
** '''index'''= treats ''name'' as an array, and specifies the element to use
** This is somewhat obsolete; it is better to use the [[W3TPL/sysdata|sysdata]] syntax
** '''isolate''': use extreme isolation to prevent parsing before output
* '''codes''': process with ShowHTML() before output
** '''lcase''': convert to lowercase before output
* '''default'''= default value to use if argument named ''arg'' is not set
** '''len'''= maximum number of characters to include; truncate after ''n''th character
** This may eventually be used to fill in a value in other cases, but for now it doesn't.
** '''name'''= name of variable to retrieve
* '''index'''= treats ''name'' as an array, and specifies the element to use
** '''raw''': output should not be parsed (usage is restricted)
* '''isolate''': use extreme isolation to prevent parsing before output
** '''ucase''': convert to uppercase before output
* '''lcase''': convert to lowercase before output
** '''val'''= expression to use instead of variable ''name''
* '''len'''= maximum number of characters to include; truncate after ''n''th character
* '''name'''= name of variable to retrieve
* '''raw''': output should not be parsed (usage is restricted)
* '''ucase''': convert to uppercase before output
* '''val'''= expression to use instead of variable ''name''

Latest revision as of 20:50, 20 April 2022

About

  • Action: Tag is replaced by the value of a variable or expression.

This tag has many operations in common with <let>; a comparison is here.

Options

unverified

Support for these options has not been confirmed as of 2022-04-20.

  • arg: get value from the http request argument named name, instead of using a stored variable
    • Retrieves value from $wgRequest->getVal(name, default)
    • This is somewhat obsolete; it is better to use the sysdata syntax
  • codes: process with ShowHTML() before output
  • default= default value to use if argument named arg is not set
    • This may eventually be used to fill in a value in other cases, but for now it doesn't.
  • index= treats name as an array, and specifies the element to use
  • isolate: use extreme isolation to prevent parsing before output
  • lcase: convert to lowercase before output
  • len= maximum number of characters to include; truncate after nth character
  • name= name of variable to retrieve
  • raw: output should not be parsed (usage is restricted)
  • ucase: convert to uppercase before output
  • val= expression to use instead of variable name