Getting started on the frontend
You will remember, the backend of our component is in the com_folio
folder under /administrator/components/
, and now we will be working on the frontend which is located in the com_folio
folder under/components/
.
We will start out by creating the folio.php
file under /components/com_folio/
, which is the first file that is executed when our component is used:
<?php defined('_JEXEC') or die; $controller = JControllerLegacy::getInstance('Folio'); $controller->execute(JFactory::getApplication()->input->get('task')); $controller->redirect();
This is pretty similar to what we have done in the backend, although it's simpler because we don't need to check to see if the user has manage permission to the component like we did in the backend. You can see that we are using the Legacy MVC classes on the frontend too.
Next, we need to create our main controller, so create the controller.php
file under /components/com_folio/
:
<?php defined('_JEXEC') or die;...