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 ...

Get Learning Joomla! 3 Extension Development - Third Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.