Allows to define new columns in the back-end user model.
The event handler should accept two parameters - the user object and the form
execution context string. To add new columns to the user model, call the
define_column()
method of the user object. Before you add new columns to the model, you should add them to the
database (the
users table).
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');
}