I followed this tutorial on how to build a component for joomla 2.5, but now I am stuck.
What I want to do: Besided thoses field defined in admin\models\forms\.xml I want to dynamically add form fields. The field list should be read from database.
I have a:
- main table
#__tours(id, title)
, - field list table
#__tourfields(id,lable,description,position)
- field value table
#__tourfieldvalues(tourid,fieldid,fieldvalue)
#__tourfields
contains a list of additional fields, that the user may want to specify for each entry in #__tours
. #__tourfieldvalues
would contain the values for the additional fields.
So now I need to figure out how to add input boxes to the edit form for each row in #__tourfields
, read the values in #__tourfieldvalues
for the currently to display entry of #__tours
.
How can I do this?
foreach
statement? – Lodder