Creating a simple component
In addition to the installation XML file, there are quite a few files you need to create to make a simple component. We'll start out by creating all the folders for the backend. In the /administrator/components/com_folio
folder, create the following folders:
controllers
helpers
models
sql
tables
views
For now, just put an index.html
file in each folder:
<!DOCTYPE html><title></title>
Creating the entry point
Now create a file in /administrator/components/com_folio
called folio.php
. This is the first file that is executed when Joomla! loads your component, and should have the same name as your component.
<?php defined('_JEXEC') or die; if (!JFactory::getUser()->authorise('core.manage', 'com_folio')) { return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR')); } $controller = JControllerLegacy::getInstance('Folio'); $controller->execute(JFactory::getApplication()->input->get('task')); $controller->redirect();
As usual, we start...