User Rating: 1 / 5

Star ActiveStar InactiveStar InactiveStar InactiveStar Inactive
 

Start building simple component

 

-create a folder com_helloworld in the Administrator/Components

-create a folder and files by topic.Chapter 6 - Introduction Component Development

-open the helloworld.php file and code this

com_helloworld/helloworld.php

 

<?php
defined('_JEXEC') or die('Restricted access'); 


if(!defined('DS')) {
        define('DS', DIRECTORY_SEPARATOR);
}


$c = JRequest::getVar('c');
if($c == '') {
        $c = 'hello'; 
}


$path = JPATH_COMPONENT_ADMINISTRATOR.DS.'controllers'.DS.$c.'.php';
if (file_exists($path)) {
        require_once $path;
} else {
      
        JError::raiseError('500',JText::_('JTUNKNOW_COMPONENT').' '.$c.' '.$path);
}

$classname = 'HelloworldController'.$c; 
$controller = new $classname(); 
$controller->execute(JFactory::getApplication()->input->get('task'));
$controller->redirect();
?>

 

-Create a file in a folder named hellp.php controllers class name must be specified in the form of posts. Chapter 7 - Structure for building class Component Development.

Then enter the code com_helloworld/controllers/hellp.php

<?php
defined('_JEXEC') or die('Restricted access'); 

class HelloworldControllerHello extends JControllerLegacy 
{
        
     
        function display($cachable = false, $urlparams = array()) 
        {
      
                JRequest::setVar('view','hello');
                parent::display($cachable, $urlparams); 
        }
    
}
?>

 To create a display in the View by to create folders as we set the set the view controller in the controller will create a folder named hello hello and interior will create a file named. view.html.php And create a folder for files tmpl default.php layout to create a basic layout files first. 

com_helloworld /views/hello/view.html.php

<?php
defined('_JEXEC') or die('Restricted access');

class HelloworldViewHello extends JViewLegacy 
{

        function display($tpl = null)
        {
                parent::display($tpl);
        }
    
}
?>

 

com_helloworld/views/hello/tmpl/default.php

<?php 

defined('_JEXEC') or die('Restricted access');

?>

Hello world

 

Summary File

com_helloworld/helloworld.php

com_helloworld/controllers/hello.php

com_helloworld/views/hello/view.html.php

com_helloworld/views/hello/tmpl/default.php

 

 

Chapter 9 - Creating XML Form Component Development

Recent Topics
Subject
Post Reply
Open
Recent
Features Review : Components MCharts untuk memproses data dari MJForms menjadi graf
By abdkode Fri 22 Feb 2019 2:02 pm Board Bahasa Language
0
2529
Fri 22 Feb 2019 2:02 pm By abdkode
Features Review : Components MDBridge untuk menyambung data pengguna antara Joomla dan PHPbb Webboard
By abdkode Thu 21 Feb 2019 6:04 pm Board Bahasa Language
0
2705
Thu 21 Feb 2019 6:04 pm By abdkode
Features Review : MDEvents untuk mengurus pelbagai jadual data aktiviti
By abdkode Thu 21 Feb 2019 4:51 pm Board Bahasa Language
0
1725
Thu 21 Feb 2019 4:51 pm By abdkode
Features Review : Component MJUpgrade untuk menaik taraf Joomla 1.5 ke Joomla 2.5, 3.X
By abdkode Thu 21 Feb 2019 4:10 pm Board Bahasa Language
0
5712
Thu 21 Feb 2019 4:10 pm By abdkode
Features Review : Mod Mslideshows untuk memaparkan gambar, video Youtube dari kandungan
By abdkode Thu 21 Feb 2019 3:29 pm Board Bahasa Language
0
1265
Thu 21 Feb 2019 3:29 pm By abdkode
Plugin Editors XTD Multicontent 사용 지침과 설명
By wipaporn Thu 21 Feb 2019 12:28 pm Board korean Language - 한국어
0
9329
Thu 21 Feb 2019 12:28 pm By wipaporn
Module M Slideshows 사용 지침과 설명
By wipaporn Thu 21 Feb 2019 12:27 pm Board korean Language - 한국어
0
5042
Thu 21 Feb 2019 12:27 pm By wipaporn
Component M Multisite Master 사용 지침과 설명
By wipaporn Thu 21 Feb 2019 12:27 pm Board korean Language - 한국어
0
5253
Thu 21 Feb 2019 12:27 pm By wipaporn
Component M Multisite Client 사용 지침과 설명
By wipaporn Thu 21 Feb 2019 12:27 pm Board korean Language - 한국어
0
8199
Thu 21 Feb 2019 12:27 pm By wipaporn
MDFiles Featured 사용 지침과 설명
By wipaporn Thu 21 Feb 2019 12:26 pm Board korean Language - 한국어
0
9423
Thu 21 Feb 2019 12:26 pm By wipaporn
Module MDFiles Popular 사용 지침과 설명
By wipaporn Thu 21 Feb 2019 12:25 pm Board korean Language - 한국어
0
5756
Thu 21 Feb 2019 12:25 pm By wipaporn
Components MDFiles 사용 지침과 설명
By wipaporn Wed 20 Feb 2019 7:13 pm Board korean Language - 한국어
0
2255
Wed 20 Feb 2019 7:13 pm By wipaporn
Features Review : Mod Menu Json untuk menyemak Nama Domain dan memaparkan artikel dari master side
By abdkode Wed 20 Feb 2019 6:53 pm Board Bahasa Language
0
2132
Wed 20 Feb 2019 6:53 pm By abdkode
Module MDFiles Recent 사용 지침과 설명
By wipaporn Wed 20 Feb 2019 6:50 pm Board korean Language - 한국어
0
5411
Wed 20 Feb 2019 6:50 pm By wipaporn
Module MDFiles Categories 사용 지침과 설명
By wipaporn Wed 20 Feb 2019 6:41 pm Board korean Language - 한국어
0
5716
Wed 20 Feb 2019 6:41 pm By wipaporn
Features Review :Mod Lastnews json slider untuk ambil artikel dari Master Site dipaparkan di Web Client secara Slide.
By abdkode Wed 20 Feb 2019 6:11 pm Board Bahasa Language
0
2469
Wed 20 Feb 2019 6:11 pm By abdkode
Component MJForm 사용 지침과 설명
By wipaporn Wed 20 Feb 2019 5:59 pm Board korean Language - 한국어
0
5526
Wed 20 Feb 2019 5:59 pm By wipaporn
Features Review : M Multisite Content untuk mengedarkan data dari Master Site ke Webclient
By abdkode Wed 20 Feb 2019 5:23 pm Board Bahasa Language
0
5295
Wed 20 Feb 2019 5:23 pm By abdkode
使用 Plugin Editors XTD Multicontent 说明手册
By wipaporn Wed 20 Feb 2019 5:18 pm Board Chinese Language - 简体中文
0
16654
Wed 20 Feb 2019 5:18 pm By wipaporn
使用 Module M Slideshows 说明手册
By wipaporn Wed 20 Feb 2019 4:56 pm Board Chinese Language - 简体中文
0
20393
Wed 20 Feb 2019 4:56 pm By wipaporn