Ajax Requests
Performing Ajax Requests in custom modules is likely something that is needed to be done at some point without refresh page.
With the Addon Modules system, this is a breeze with the ajax function. The ajax function is called to handle Ajax Requests.
You can get request and post parameters using
$_POST
, $_GET
and $_REQUEST
in ajax function.Addon Ajax Request URL:
https://your-domain.com/admin/addons/youraddonname/ajax
AJAX Function:
An example of how this function can be used is demonstrated below:
<?php
function yourmodule_ajax($params=[]) {
//Your code perform here
$html = 'Text or html output';
echo $html;
}