Error when adding address field in publicRegistration

I’m stuck on this error, I tried fixing this error.

$row = $form->addRow();
$row->addAlert((‘Address information for an individual only needs to be set under the following conditions:’), ‘warning’)

  1. ’.(‘If the user is not in a family.’).‘
  2. ’)
  3. ’.(‘If the user\‘s family does not have a home address set.’).’
  4. ‘)
  5. '.(‘If the user needs an address in addition to their family\‘s home address.’).’
  6. ‘)

$row = $form->addRow()->addClass('address');
$row->addLabel('address1', __('Address 1'))->description(__('Unit, Building, Street'));

$row = $form->addRow()->addClass('address');
$row->addLabel('address1District', __('Address 1 District'))->description(__('County, State, District'));

$row = $form->addRow()->addClass('address');
$row->addLabel('address1Country', __('Address 1 Country'));

I copied this code from user_manage_add.php

can someone please guide me?

Adding the following line at the top should fix this:

use Gibbon\Forms\DatabaseFormFactory;


Thanx for the help!

When I added it it didn’t work at first.
After I added this it worked for me. (line 63 & 64)

I hope it helps someone.

Again thnx @meierrom !