Template:FunctionDeclaration
Displays an ASH function's declaration. This is meant to be transcluded by other templates, rather than regular pages.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Function page name | name | Name of a function page. '''This must be a data page.''' | Page name | required |
Overloaded function number | func | A function page may describe multiple overloaded functions under the same name. This parameter allows you to select one. Allowed values are 1-5, inclusive. | Number | required |
Rendering format | format | "" (empty string) = show everything, "signature" = only show parameter types (i.e. function signature). Default value is empty string (show everything). | Line | optional |
Show descriptions? | desc | If set to "yes", also show the description of each function and its parameters below the declaration. Technically, any non-empty string works, but please use "yes" for ease of maintenance. | Line | optional |
Show parameter descriptions? | param_desc | If set to "yes", also show the description of each function's parameters below the declaration. Technically, any non-empty string works, but please use "yes" for ease of maintenance. | Line | optional |
Examples
Wiki markup | Result |
---|---|
Normal format | |
{{FunctionDeclaration|name=visit_url|func=1}} |
buffer visit_url() |
{{FunctionDeclaration|name=visit_url|func=2}} |
buffer visit_url( string url, [boolean? use_POST = true], [boolean? encoded = false] ) |
Normal format with description | |
{{FunctionDeclaration|name=visit_url|func=1|desc=yes}} |
buffer visit_url() Returns the original HTML source of the page being overridden inside a relay override script. |
{{FunctionDeclaration|name=visit_url|func=2|desc=yes}} |
buffer visit_url( string url, [boolean? use_POST = true], [boolean? encoded = false] ) Visits a web page and returns its HTML source. |
Normal format with description + parameter description | |
{{FunctionDeclaration|name=visit_url|func=1|desc=yes|param_desc=yes}} |
buffer visit_url() Returns the original HTML source of the page being overridden inside a relay override script. |
{{FunctionDeclaration|name=visit_url|func=2|desc=yes|param_desc=yes}} |
buffer visit_url( string url, [boolean? use_POST = true], [boolean? encoded = false] ) Visits a web page and returns its HTML source.
|
Signature format | |
{{FunctionDeclaration|name=visit_url|func=2|format=signature}} |
buffer visit_url( string, [boolean?], [boolean?] ) |
Invalid or missing function number | |
{{FunctionDeclaration|name=visit_url|func=4}} |
Invalid function number (func = "4") in Template:FunctionDeclaration |
{{FunctionDeclaration|name=visit_url|func=0}} |
Invalid function number (func = "0") in Template:FunctionDeclaration |
{{FunctionDeclaration|name=visit_url}} |
Invalid function number (func = "") in Template:FunctionDeclaration |