Différences entre les versions de « Utilisateur:Mathompson »

De Semantic MediaWiki - Sandbox

m
Ligne 2 : Ligne 2 :
 
Invocation:
 
Invocation:
  
<nowiki>{{#invoke:Smw|ask|[[Modification date::+]]|?Modification date|sort=Modification date|order=desc}}</nowiki>
+
<nowiki>{{#invoke:ScribuntoTest|asktype}}</nowiki>
  
 
After fix, this should contain information from the first item in the query result set:
 
After fix, this should contain information from the first item in the query result set:

Version du 8 septembre 2016 à 20:15

Semantic Scribunto invocation

Invocation:

{{#invoke:ScribuntoTest|asktype}}

After fix, this should contain information from the first item in the query result set:

mw.ext.smw module not found

Explanation

The invocation returns a number that is the "query-continue-offset" value for the query result. This is because the first element in the array returned by the PHP code for the extension is the "query-continue-offset" value. If the entire result object is wrapped in another array, the Lua code will receive the entire result array (which will be of type "table" once Lua has it) from the PHP code (because that array is now the first element of the return value.)

Directly outputting the invocation result is not generally useful (as it is intended to be processed further by other Lua code or by templates), but I am providing direct output here for demonstration purposes.

Les cookies nous aident à fournir nos services. En utilisant nos services, vous acceptez notre utilisation de cookies.