Allows to add new fields to the Create/Edit User form in the Administration Area.
Usually this event is used together with the
core:onExtendUserModel event.
To add new fields to the user form, call the
add_form_field() method of the
user object.
public function subscribeEvents()
{
Backend::$events->addEvent('core:onExtendUserModel', $this, 'extend_user_model');
Backend::$events->addEvent('core:onExtendUserForm', $this, 'extend_user_form');
}
public function extend_user_model($order, $context)
{
$order->define_column('x_gender', 'Gender');
}
public function extend_user_form($order, $context)
{
$order->add_form_field('x_gender')->tab('Contacts');
}