I am writing PHP API for Joomla3.9 website where I need to deliver the HTML produced by mod_articles_category modules. I tried blow code to get Module HTML output but it does not working any more It shoiwng the erro someting like that "Call to a member function get() on null"
define('_JEXEC', 1);
include_once DIR . '/defines.php';
require_once JPATH_BASE . '/includes/defines.php';
require_once JPATH_BASE . '/includes/framework.php';
$app = JFactory::getApplication('site');
jimport('joomla.application.module.helper');
$document = JFactory::getDocument();
$renderer = $document->loadRenderer('module');
$module = JModuleHelper::getModule('mod_articles_category', 'Module title I used here');
echo $renderer->render($module);
?>
Basically I need this module HTML output in the same way as it render on Joomla pages so that I can send this out to REST API user. It showi
Please suggest me