How to add a New Format to your Joomla 3 Component?

> Please Create a new “view file"

/components/com_helloworld/views/helloworld/view.xml.php

> We have created an XML file for testing you can create any other format file like JSON

> Please write the PHP code in the file you just created, that you would like to ultimately create your XML file. belolw is our example code

<?php // No direct access to this file defined('_JEXEC') or die('Restricted access'); // import Joomla view library jimport('joomla.application.component.view'); /** * XML View class for the HelloWorld Component */ class HelloWorldViewHelloWorld extends JViewLegacy { // Overwriting JView display method function display($tpl = null) { echo "<?xml version='1.0' encoding='UTF-8'?> <article> <title>How to create a Joomla Component</title> <alias>create-component</alias> </article>"; } }
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to Enable Two Factor Authentication in Joomla 3.5?

> Please login to Joomla admin dashboard > You will have a notification, please click on...

How to Change an Article Category in Joomla 3.5?

> Please login to your Joomla 3.5 Admin Dashboard > Please go to Content > click...

How to Create a New Category in Joomla 3.5?

> Please login to Joomla 3.5 Admin Dashboard > Please click on the Content > Catagory...

How to Create a New Article in Joomla 3.5?

> Please login to your Joomla 3.5 Admin Dashboard > Please Click Content > Articles...

How to Log in to your Joomla 3.5 Dashboard?

> Please navigate your site with "/administrator", for e.g. domain.com/administrator >...

Powered by WHMCompleteSolution