Connecting to the database
So now the next file we need to create is helper.php
which contains our database connection and gets the data ready to display in the view. You should create this file in your mod_latestextensions
folder.
<?php defined('_JEXEC') or die; abstract class mod_latestextensionsHelper { public static function getList(&$params) { $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select('name, extension_id, type'); $query->from('#__extensions'); $query->order('extension_id DESC'); $db->setQuery($query, 0, $params->get('count', 5)); try { $results = $db->loadObjectList(); } catch (RuntimeException $e) { JError::raiseError(500, $e->getMessage()); return false; } foreach ($results as $k => $result) { $results[$k] = new stdClass; $results[$k]->name = htmlspecialchars( $result->name ); $results[$k]->id = (int)$result->...