Creating the module PHP file
There is actually more than one PHP file used in our module, we are going to create three. We will start out by creating a file mod_latestextensions.php
in our mod_latestextensions
folder, which is the first file that is executed when Joomla! loads our module. Create the file and add the following code:
<?php defined('_JEXEC') or die; require_once __DIR__ . '/helper.php'; $list = mod_latestextensionsHelper::getList($params); $moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx')); require JModuleHelper::getLayoutPath('mod_latestextensions', $params->get('layout', 'default'));
All our PHP files will include the defined
or die
statement that prevents people from directly executing this PHP file. We then use require_once
to load a helper file which we are going to use to do all our database queries and prepare the data for the view.
require_once __DIR__ . '/helper.php';
We then need to load the data from the helper and put it into an array called...