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 O’Reilly online learning.

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