0

I am developing a Joomla 2.5 component. So I'm using Hello world example component for reference... In the edit view of the admin back end

 <?php foreach($this->form->getFieldset('details') as $field): ?> <div>
 <?php echo $field->label; echo $field->input;?> </div>

where the array $this->form->getFieldset('details') is stored.. and how to add new fields to the form that will store the data to another database table. where to change the fielda of the forms.

Praveen Kumar
  • 206
  • 4
  • 14

1 Answers1

0

If you need to add more fields in your form then you can add new field in to the helloworld.xml browse to the following file on to

administrator->components->com_helloworld->models->forms->helloworld.xml 

Open this file you will find the number of fields are listed over there you can add your own field by copy any of the field and rename it as you want.

You can also refer this link : J2.5:Developing a MVC Component/Adding backend actions

For example you want to add description field on to your form then you just need to add this line between the fieldset tag.

<field
      name="description"
      type="text"
      label="COM_HELLOWORLD_HELLOWORLD_DESCRIPTION_LABEL"
      description="COM_HELLOWORLD_HELLOWORLD_DESCRIPTION_DESC"
      size="40"
      class="inputbox"
      default=""
/>

I would prefer you first read full tutorial of how to create MVC component for Joomla.Then you would be able to know how it works. Here the link :

J2.5:Developing a MVC Component/Developing a Basic Component

You may also use different form field type : Form field

Toretto
  • 4,721
  • 5
  • 27
  • 46