I am working on a system plugin which uses its own custom field. The plugin has an XML looking like this:
<config>
<fields name="params" addfieldprefix="Joomla\Plugin\System\MyPlugin\Field">
<fieldset name="basic">
<field name="api-key" label="api-key" type="password" />
Now i need to use the API key in the custom field. The custom field is working inside the plugin, but how to access the config param from the plugin inside the custom field?
namespace Joomla\Plugin\System\MyPlugin\Field;
use Joomla\CMS\Factory;
use Joomla\CMS\Form\Field\ListField;
\defined('_JEXEC') or die;
class MyCustomField extends ListField
{
protected $type = 'MyCustom';
public function getOptions()
{
// Trying to access the API Key from the Plugin config
var_dump($this->form->getField('api-key', 'params'));
When using this i only get the data from the custom field, nothing about the plugin config embeding it:
echo $this->form->getData()