$form->getAttribute is deprecated, use $form->getConfig()->getAttribute()