Developing an edit item view for our component
Besides listing projects from the database, our component is a tool to manage them. As a project manager, you need to be able to edit your projects. Let’s see how we can edit our projects in this section.
To add an edit screen for our projects, we will create an edit view for our projects. To do this, we need the following:
- A
Project
view inside ourView
folder - A model to get the data or our project from the database and to save our changes
- A layout file inside the
tmpl
folder to show our edit form - A
ProjectController
field inside ourController
folder
Let’s start our first edit item view.
Creating a Project view
A single-item view looks quite like the list view in Joomla!, but there are some important changes we need to be aware of. To add this view, create the src/component/admin/src/View/Project/HtmlView.php
file and then the HTMLView
class extending it, as we did in the previous section...