$GLOBALS['TL_EVENTS']['tl_foo.some_select.create-options'][] = array(
function($event) {
$options = $event->getOptions();
// remove a default value
unset($options['value2']);
// add a new value
$options['value4'] = 'label 4';
},
-10 // we need a lower priority here, to make sure this listener is triggered after the default listener
);
class MyCreateOptionsEvent extends \ContaoCommunityAlliance\Contao\Events\CreateOptions\CreateOptionsEvent
{
protected $additionalData;
function __construct($additionalData, \DataContainer $dataContainer, \ArrayObject $options = null)
{
parent::__construct($dataContainer, $options);
$this->additionalData = $additionalData;
}
public function getAdditionalData()
{
return $this->additionalData;
}
}