> Please create a new view’s folder:
/components/helloworld/views/howdyfriends
we have named this view howdyfriends
> Please Create a new HTML version of the view:
/components/helloworld/views/howdyfriends/view.html.php
<?php // No direct access to this file defined('_JEXEC') or die('Restricted access'); // import Joomla view library jimport('joomla.application.component.view'); /** * HTML View class for the HowdyFriends view */ class HelloWorldViewHowdyFriends extends JViewLegacy { // Overwriting JView display method function display($tpl = null) { // Assign data to the view $this->msg = 'Howdy Friends, welcome to component development!'; // Display the view parent::display($tpl); } }
> Please Create a “templates” folder:
/components/helloworld/views/howdyfriends/tmpl
> Please Create a default template file:
/components/helloworld/views/howdyfriends/tmpl/default.php
<?php // No direct access to this file defined('_JEXEC') or die('Restricted access'); ?> <h1><?php echo $this->msg; ?></h1>