User Rating: 2 / 5

Star ActiveStar ActiveStar InactiveStar InactiveStar Inactive
 
Creating the Component Config

 

Let's start creating buttons for clicking into the config page by page to build a list of data. In the examples use the Component Name com_helloworld.

Open the folder into the folder views hellos edit the file view.html.php. 

com_helloworld/views/hellos/view.html.php

function addToolbar() 
{
    JToolbarHelper::title(JText::_('COM_HELLOWORLD_HELLO_HELLO_LIST'));
    JToolbarHelper::addNew('add');
    JToolbarHelper::editList('edit');
    JToolbarHelper::deleteList('Are you sure?', 'delete');
    JToolbarHelper::preferences('com_helloworld'); // สร้างปุ่มสำหรับเข้าสู่หน้า config

    JHtmlSidebar::setAction('index.php?option=com_content&view=articles');

    JHtmlSidebar::addFilter(
            JText::_('JOPTION_SELECT_PUBLISHED'),
            'filter_published',
            JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true)
    );

 

Next, create a config.xml file in the folder com_helloworld. It uses a similar structure to create XML Form. 

com_helloworld/config.xml

<?xml version="1.0" encoding="utf-8"?>
<config>
   <fieldset
      name="setting"
      label="Setting">

      <field
         name="date_format" 
                        type="text"
         label="Date Format"
      />
   </fieldset>
        <fieldset
      name="permissions"
      label="JCONFIG_PERMISSIONS_LABEL"
      description="JCONFIG_PERMISSIONS_DESC"
      >

      <field
         name="rules"
         type="rules"
         label="JCONFIG_PERMISSIONS_LABEL"
         class="inputbox"
         validate="rules"
         filter="rules"
         component="com_content"
         section="component" />
   </fieldset>
</config>

 

 

For the values ​​defined in the config used.

 

$config = JComponentHelper::getParams('com_helloworld');
echo $config->get('date_format')

 

Chapter 18 - (Access Control List) Component Development

Recent Topics
Subject
Post Reply
Open
Recent
How To Add New Facebook Friends using Facebook Phone Number?
By Anonymous Tue 07 Jan 2020 4:20 pm Board English Language
0
761
Tue 07 Jan 2020 4:20 pm By Anonymous
DBA Training Institute
By Shrutiii Wed 01 Jan 2020 3:06 pm Board English Language
0
793
Wed 01 Jan 2020 3:06 pm By Shrutiii
Tools for calculating the withholding tax easily reduce large tax
By prmindphp Wed 25 Dec 2019 6:56 pm Board English Language
0
795
Wed 25 Dec 2019 6:56 pm By prmindphp
Helper to calculate interest rates for investors
By prmindphp Tue 24 Dec 2019 6:52 pm Board English Language
0
864
Tue 24 Dec 2019 6:52 pm By prmindphp
Plan your savings easily with FV (Future Value) Calculator
By prmindphp Mon 23 Dec 2019 7:28 pm Board English Language
0
748
Mon 23 Dec 2019 7:28 pm By prmindphp
Payment Calculator, Installment calculation to make decisions
By prmindphp Fri 20 Dec 2019 6:00 pm Board English Language
0
798
Fri 20 Dec 2019 6:00 pm By prmindphp
Program Calculate Home Loan, Tools that will help you calculate home loans easily and quickly
By prmindphp Thu 19 Dec 2019 6:59 pm Board English Language
0
867
Thu 19 Dec 2019 6:59 pm By prmindphp
The website loads slowly ? The image size is not proportional, MImageoptimize Plugin of Joomla can help
By prmindphp Tue 17 Dec 2019 7:05 pm Board English Language
0
751
Tue 17 Dec 2019 7:05 pm By prmindphp
Calculation program Number of Periods (NPER)
By prmindphp Mon 16 Dec 2019 7:21 pm Board English Language
0
850
Mon 16 Dec 2019 7:21 pm By prmindphp
Calculation program after including VAT
By prmindphp Fri 13 Dec 2019 5:32 pm Board English Language
0
1056
Fri 13 Dec 2019 5:32 pm By prmindphp
Plugin Content MChangelog ,helps add content that has changed, update, and fix the problem
By prmindphp Thu 12 Dec 2019 6:46 pm Board English Language
0
876
Thu 12 Dec 2019 6:46 pm By prmindphp
Pace Calculator
By prmindphp Wed 11 Dec 2019 6:53 pm Board English Language
0
816
Wed 11 Dec 2019 6:53 pm By prmindphp
Introducing to MooZiiCart's Coupons feature, create coupons on website sell products online it is certain to boost sales
By prmindphp Mon 09 Dec 2019 11:06 am Board English Language
0
770
Mon 09 Dec 2019 11:06 am By prmindphp
Introducing to MooZii Opencart - Template MooZiicart create a beautiful website by yourself
By prmindphp Fri 06 Dec 2019 10:47 am Board English Language
0
757
Fri 06 Dec 2019 10:47 am By prmindphp
Introducing the new Mindphp.com Webboard system function (phpbb v.3.2)
By mindphp Wed 04 Dec 2019 8:45 pm Board English Language
0
671
Wed 04 Dec 2019 8:45 pm By mindphp
Module "Login" of MooZiicart easy to use, just install
By prmindphp Tue 03 Dec 2019 1:32 pm Board English Language
0
173
Tue 03 Dec 2019 1:32 pm By prmindphp
Module "MooZiiCart Search" of MooZiicart for search keywords of what we want
By prmindphp Mon 02 Dec 2019 11:31 am Board English Language
0
187
Mon 02 Dec 2019 11:31 am By prmindphp
Features Component MooZiiCart in Joomla for create website to sell products online
By prmindphp Sat 30 Nov 2019 7:00 pm Board English Language
2
2178
Wed 08 Apr 2020 6:51 pm By prmindphp
Business Analyst Training
By NehaaB Fri 29 Nov 2019 5:27 pm Board English Language
0
103
Fri 29 Nov 2019 5:27 pm By NehaaB
Program convert area
By prmindphp Wed 27 Nov 2019 11:26 am Board English Language
0
103
Wed 27 Nov 2019 11:26 am By prmindphp