Developer Center

Defining Custom Pages and Functions for Client Area

The pages/ is the directory where the pages are located. The name of the page that you will create in it must be prefixed with "clientArea-" phrase. You can use (lower/upper case letter, number and "-_" as special character) in the name, and .php must be typed as an extension.

The variables you can use in the content of the PHP file of page:

  • $module variable retrieves the content of your module class.

To link to another page within a page, see the examples below.

Javascript Ajax Method

<a href="javascript:reload_module_content('example-page'); void 0;">Example Custom Page</a>

Page Refreshing Method

<a href="<?php echo $module->area_link; ?>?m_page=example-page">Example Custom Page</a>

Defining a Custom Function

When naming the function you will create in the class, you must use use_clientArea_ in its prefix.

Custom Function Usage Areas

  • Used to display a content you will reflect without including the site theme.
  • Used to get a process done and get a result when the buttons are clicked.
  • Used to process form data that you created in the custom page.
public function use_clientArea_custom_function()
{
    if(Filter::POST("var2"))
    {
        echo  Utility::jencode([
            'status' => "successful",
            'message' => 'Successful message',
        ]);
    }
    else
    {
        echo "Content Here...";
    }

    return true;
}

See the following examples for use in the page php file.

Javascript Ajax Method

<a href="javascript:void 0;" onclick="run_transaction('custom_function',this);" data-fields='{"var1":"test1","var2":"test2"}'>Example Custom Function</a>

Page Refreshing Method

<a href="<?php echo $module->area_link; ?>?action=use_method&method=custom_function">Example Custom Function</a>
Fixed Functions and Return Multi-Purpose Cleint Area Buttons

Do you have any questions?

Feel free to contact us
Contact Us
Copyright © 2024. All Rights Reserved.
Join Our Discord Channel
Top