On February 19, 2021 . By CodimTh Category: Web Drupal How to test if a form is an entityForm in Drupal 9 Example How to test if a form is an entityForm in Drupal 9: if ( $form_state->getFormObject() instanceof EntityForm ) { $entity = $form_state->getFormObject()->getEntity(); } Tags : Drupal Tutorial Drupal Tips Drupal Previous PostHow do I define checkboxes in a form in Drupal 9Next PostHow to make modification of a revision log field in drupal 8 & 9 Comments Add new comment Your name Subject Comment About text formats Restricted HTML Leave this field blank
Comments