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
    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 – mickmackusa Oct 9 at 20:17
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, privacy policy and cookie policy

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