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
Program exchange rate - Information form Bank of Thailand API
By prmindphp Tue 26 Nov 2019 2:34 pm Board English Language
0
106
Tue 26 Nov 2019 2:34 pm By prmindphp
Tracking Thailand Post Program
By prmindphp Mon 25 Nov 2019 5:47 pm Board English Language
0
139
Mon 25 Nov 2019 5:47 pm By prmindphp
Square Root Calculate Program
By prmindphp Fri 22 Nov 2019 11:30 am Board English Language
0
170
Fri 22 Nov 2019 11:30 am By prmindphp
The program calculates the mean, the variable, the standard deviation
By prmindphp Fri 22 Nov 2019 11:12 am Board English Language
0
139
Fri 22 Nov 2019 11:12 am By prmindphp
Introducing the new Mindphp.com Webboard system function (phpbb v.3.2)
By numtan5839 Tue 19 Nov 2019 6:06 pm Board English Language
0
142
Tue 19 Nov 2019 6:06 pm By numtan5839
The most popular currency pairs in the Forex for new traders
By numtan5839 Mon 18 Nov 2019 5:32 pm Board English Language
0
136
Mon 18 Nov 2019 5:32 pm By numtan5839
BIG DATA and Hadoop
By Inglejyoti Mon 18 Nov 2019 4:03 pm Board English Language
0
222
Mon 18 Nov 2019 4:03 pm By Inglejyoti
The most popular currency in the Forex
By numtan5839 Mon 18 Nov 2019 3:24 pm Board English Language
0
124
Mon 18 Nov 2019 3:24 pm By numtan5839
How to use the SQRT function in Excel
By numtan5839 Mon 18 Nov 2019 2:46 pm Board English Language
0
168
Mon 18 Nov 2019 2:46 pm By numtan5839
Deposit money into account with Thailand Post by Bank@post service
By numtan5839 Mon 18 Nov 2019 11:42 am Board English Language
0
186
Mon 18 Nov 2019 11:42 am By numtan5839
Benefits and applications of moving averages
By numtan5839 Mon 18 Nov 2019 10:47 am Board English Language
0
153
Mon 18 Nov 2019 10:47 am By numtan5839
Moving Average
By numtan5839 Sat 16 Nov 2019 2:45 pm Board English Language
0
135
Sat 16 Nov 2019 2:45 pm By numtan5839
weighted arithmetic mean
By numtan5839 Sat 16 Nov 2019 11:56 am Board English Language
0
112
Sat 16 Nov 2019 11:56 am By numtan5839
Digital Marketing Training in Mumbai
By Kanchaan Fri 15 Nov 2019 6:10 pm Board English Language
1
774
Fri 06 Dec 2019 3:16 pm By benjamin28
Thailand Post appease e-commerce with ePacket service
By numtan5839 Fri 15 Nov 2019 5:59 pm Board English Language
0
267
Fri 15 Nov 2019 5:59 pm By numtan5839
The character that precedes Tracking Number - Thailand Post Track & Trace
By numtan5839 Fri 15 Nov 2019 5:09 pm Board English Language
0
111
Fri 15 Nov 2019 5:09 pm By numtan5839
downloading MD Watermark
By bfred Fri 04 Oct 2019 3:21 pm Board English Language
6
1287
Mon 30 Dec 2019 7:26 pm By mindphp
Features Review : Component Mjform Advance untuk meningkatkan form atau borang untuk laman web dgn lebih baik
By abdkode Mon 22 Apr 2019 6:51 pm Board Bahasa Language
0
9104
Mon 22 Apr 2019 6:51 pm By abdkode
Features Review : Mhosting Components untuk mengumpul Packet hosting
By abdkode Mon 22 Apr 2019 6:50 pm Board Bahasa Language
0
1794
Mon 22 Apr 2019 6:50 pm By abdkode
Features Review : Components MD Gallery untuk membuat gelari dalam laman web
By abdkode Mon 22 Apr 2019 6:49 pm Board Bahasa Language
0
3974
Mon 22 Apr 2019 6:49 pm By abdkode