Developing a list view for a component
Hooray! We have created our first Joomla! component, and it’s installed in the backend of our site! However, we must admit that it does not do much yet. Let’s make it a bit more useful.
In the previous chapter, we installed some sample data for the database in the tables of our component. Let’s create a list view for the project’s data.
Adding the view for projects data
We will start by adding a folder named Projects
inside the src/component/admin/src/View
folder.
Inside this folder, we also add our HtmlView.php
file, but now, this file will have some code to call the model and get the data before passing it to the template:
<?php namespace Piedpiper\Component\Spm\Administrator\View\ Projects; use Joomla\CMS\MVC\View\GenericDataException; use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView; class HtmlView extends BaseHtmlView { public $filterForm; ...