{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Admin Area Content/Output","description":"Developer documentation for the WHMCS API — the","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"admin-area-contentoutput","__idx":0},"children":["Admin Area Content/Output"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The output from modules is defined in the function ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["your_module_name_output"]},"."," ","This should be actually output (i.e. echo’d) and not returned."," ","All output is captured by WHMCS and displayed within the admin interface template."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"variables","__idx":1},"children":["Variables ",{"$$mdtype":"Tag","name":"a","attributes":{"id":"variables"},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The output function is passed all the fields defined in your modules configuration function, along with the values users have set for them, as well as a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["modulelink"]}," parameter which provides the URI to link back to the module."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"linkingactions","__idx":2},"children":["Linking/Actions ",{"$$mdtype":"Tag","name":"a","attributes":{"id":"linking"},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Using the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["modulelink"]}," parameter you can build urls that post back to your module."," ","The modulelink will be in the format \"",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["addonmodules.php?module=xxxxxx"]},"\". For links you can then append “",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["&var1=x&var2=y"]},"”."," ","For forms, use the POST form method to receive user input."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Within the output function, the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["$_GET"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["$_POST"]}," variables can be accessed directly to retrieve user input."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"admin-user-data","__idx":3},"children":["Admin User Data ",{"$$mdtype":"Tag","name":"a","attributes":{"id":"admin-user-data"},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To access the currently logged in admin user ID, use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["$_SESSION['adminid']"]},"."," ","You can use the ID to retrieve any additional information that is required from the tbladmins table in the database."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"example-output-function","__idx":4},"children":["Example Output Function ",{"$$mdtype":"Tag","name":"a","attributes":{"id":"example-function"},"children":[]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"function demo_output($vars) {\n\n    $modulelink = $vars['modulelink'];\n    $version = $vars['version'];\n    $option1 = $vars['option1'];\n    $option2 = $vars['option2'];\n    $option3 = $vars['option3'];\n    $option4 = $vars['option4'];\n    $option5 = $vars['option5'];\n    $option6 = $vars['option6'];\n    $LANG = $vars['_lang'];\n\n    echo '<p>The date & time are currently ' . date(\"Y-m-d H:i:s\") . '</p>';\n\n}\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Things aren't limited to just one file."," ","Use the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["_output"]}," function to include other files, call templates, etc."," ","The system is flexible."]}]},"headings":[{"value":"Admin Area Content/Output","id":"admin-area-contentoutput","depth":1},{"value":"Variables","id":"variables","depth":2},{"value":"Linking/Actions","id":"linkingactions","depth":2},{"value":"Admin User Data","id":"admin-user-data","depth":2},{"value":"Example Output Function","id":"example-output-function","depth":2}],"frontmatter":{"title":"Admin Area Content/Output","seo":{"title":"Admin Area Content/Output"}},"lastModified":"2026-08-03T17:00:42.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/addon-modules/admin-area-output","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}