2022 Developer Survey is open! Take survey.

New answers tagged

2 votes
Accepted

Dynamically add option to Jform field

You're already aware of Joomla\CMS\Form\Field\ListField::addOption() method. value is an attribute in the XML so it needs to be passed along with other attributes in the second argument: $this->...
user avatar
  • 8,222

Top 50 recent answers are included