0

I am creating a custom form field inside a module that generates groups of fields according to total number of records in a database table.

Inside the groups of fields there are text fields but also want to display a file selector dropdown field.

I am questioning if it is possible to display joomlas filelist field by calling it from inside my custom field model php file.

So ideally inside my php I could call like:

echo createFilelistField(options) and in the module form it will display the fileslist dropdown.

I think I can use JHTMLselect and pass the array of files using JFile (or no?) but becasue this already exist as code in the joomla filelist field, it would be nice to know if there is a quick way to directly call it from php.

Anyone knows a solution, so to maximize what is avaliable in joomla?

1

Have you tried just initializing the class?

You have something like this in your custom form field in your module:

class JFormFieldMyCustomField extends JFormField {
    ....
}

Where you want to call it, you should just be able to:

$field = new JFormFieldMyCustomField;
$field->value = 'inputValue';
$field->name = 'inputName';
// ... etc
echo $field->renderField();

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.