Creating a view
In case you skipped all the JForm pages, this is where our hands-on example continues.
Our component has two views: a list view to show a list of all the items in our jos_folio
table, and an edit view that allows you to add new records and edit existing ones.
The list view
There are several files that work together to create the view. We have already created the controller file that calls the view, and the model file that prepares the data. But we have not yet created the view files that display the information.
The view.html.php file
Create the folder /administrator/components/com_folio/views/folios
, and within that create a folder called tmpl
. Remember to put an index.html
file in each folder. Now create the file /administrator/components/com_folio/views/folios/view.html.php
. The view.html.php
file is where all the toolbar buttons and title for the view are defined, and it calls the model to get the data ready to give to the view.
<?php defined('_JEXEC') or die; class FolioViewFolios...