Creating a view

Next, we need to create a view on the frontend. By default, Joomla! will be looking for a view with the same name as our component, /components/com_mycomponent/views/mycomponent, but it is not necessary to use the component name for the default view; you can specify a different name.

Our first view is going to be similar to our preview view that we created in the backend. It's going to display an image, that when clicked, goes to a URL, and it will show details such as company name and phone number.

Create the folder named folios under /components/com_folio/views/, and within that, create a folder named tmpl, both with index.html files.

Create the view.html.php file under /components/com_folio/views/folios/ with the following code: ...

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

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.