Redirected from User:SteveB/Show Implicit Environment

How do I... Know which values are implicitly passed to my extension?

Table of contents
No headers

When an extension function is invoked, Deki passed along an implicit environment.  The values in the implicit environment contain information about the page, user, and site on which the funciton is being invoked on.  This makes it possible to customize the output without requiring the function to explicitly receive these values.

The code below shows the implicit values for page, user, and site.

Function Code

<function>
  <name>implicit</name>
  <description>Test implicit arguments.</description>
  <return>
    <html xmlns:eval="http://mindtouch.com/2007/dekiscript">
      <body>
        Site: <eval:expr>site</eval:expr><br />
        Page: <eval:expr>page</eval:expr><br />
        User: <eval:expr>user</eval:expr><br />
      </body>
    </html>
  </return>
</function>

Invocation

{{ test.implicit() }}

Site: { host : "developer.mindtouch.com", language : "en-us", name : "MindTouch Community Portal", uri : "http://developer.mindtouch.com/" }
Page: { date : "Wed, 08 Apr 2009 23:02:19 GMT", id : "23736", language : "", namespace : "", path : "DekiScript/FAQ/How_do_I..._Know_which_values_are_implicitly_passed_to_my_extension?", title : "How do I... Know which values are implicitly passed to my extension?", uri : "http://developer.mindtouch.com/DekiScript/FAQ/How_do_I..._Know_which_values_are_implicitly_passed_to_my_extension%3f" }
User: { anonymous : "true", emailhash : "d41d8cd98f00b204e9800998ecf8427e", id : "754", name : "Anonymous", uri : "http://developer.mindtouch.com/User:Anonymous" }

Tag page
You must login to post a comment.