2

I need to get all other module field-params of the current module inside of a custom form field in backend.

In tmpl/default.php it works with:

$bgcolor = $params->get('bgcolor');

But in custom field file /fields/myfield.php it doesn´t work.

This is what i tried:

$module = JModuleHelper::getModule('mod_featured_image');
$moduleParams = new JRegistry($module->params);

and

$app = JFactory::getApplication();
$params = $app->getParams('mod_featured_image');
$param = $params->get('module_tag');

without success.

1
  • 1
    In the future, please avoid the vague expression "it doesn't work". By posting more precise symptoms of your issue (e.g. the value is... null, "an empty string", "generates a Notice/Warning/Error"; or "I get a 404 error", etc.), volunteers can better understand the problem AND researchers can more easily find the page via search engines and be more confident that they are encountering the same issue themselves. Providing this clarity also proves the quality of your effort to debug, research, and attempt to self-solve prior to posting a question. A good post anyhow. +1 Oct 9, 2019 at 20:17

1 Answer 1

1

Get the value from current form.

$bgcolor = $this->form->getField('bgcolor', 'params')->value;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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