Defining Custom Function for Admin Area
When naming the function you will create in the class, you must use use_adminArea_ 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.
public function use_adminArea_custom_function()
{
if(Filter::POST("test2"))
{
echo Utility::jencode([
'status' => "successful",
'message' => 'Successful message',
]);
}
else
{
echo "Content Here...";
}
return true;
}
See the following examples for its use in pages/order-detail.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; ?>?operation=operation_server_automation&use_method=custom_function">Example Custom Function</a>