Allows to add new fields to the Create/Edit Partial form.
Usually this event is used together with the
cms:onExtendPartialModel event.
The event handler should accept two parameters - the partial object and the form execution context string.
To add new fields to the partial form, call the
add_form_field() method of
the partial object.
public function subscribeEvents()
{
Backend::$events->addEvent('cms:onExtendPartialModel', $this, 'extend_partial_model');
Backend::$events->addEvent('cms:onExtendPartialForm', $this, 'extend_partial_form');
}
public function extend_partial_model($partial, $context)
{
$partial->define_column('x_extra_description', 'Extra description');
}
public function extend_partial_form($partial, $context)
{
$partial->add_form_field('x_extra_description');
}