Question

I am currently working on developing my first WHMCS Addon Module, and so far everything has gone very well. However, I need to make multiple content pages, and the only way to display output according to the Wiki Article is to echo it in the output function. How can I create individual pages when the only way to display content is via a single PHP function?

I am assuming using divs, and hiding the relevant divs, although not exactly the best method. It says you can use the "modulelink" variable to link back to the module, but I have no idea how to use this, or if it can be used for making multiple content pages.

http://docs.whmcs.com/Addon_Module_Developer_Docs

Was it helpful?

Solution

After some tinkering, it was much more simple than I realized, and the "modulelink" variable was just so you could link back to the page. To create additional pages, you can basically just do something along the lines of...

<a href="addonmodules.php?module=device_portal&catid=1">Datacenters</a>

Then in the output function have...

$category = $_GET['catid'];

if ($category == "1" || $category == "")
{
//page 1 content here
}
else if ($category == "2")
{
//page 2 content here
}

and so on.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top