Created
April 10, 2025 14:01
-
-
Save patrickmaciel/92eefc53c0e32245f24b740d1c63b91a to your computer and use it in GitHub Desktop.
Iterar os campos de um formulario form_state do drupal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$node = $form_state->getFormObject()->getEntity(); | |
$all_fields = []; | |
foreach ($node->getFields() as $field_name => $field_item_list) { | |
$all_fields[$field_name] = $field_item_list->getValue(); | |
} | |
// Use $all_fields conforme necessário | |
echo '<pre>'; | |
print_r($all_fields); | |
echo '</pre>'; | |
exit; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment