Display everything about a form in Drupal 5
To display everything about every form, Agaric uses this in a form_alter hook implementation:
drupal_set_message('<p>Form ID: ' . $form_id . '</p><pre>' . print_r($form, TRUE) . '</pre>');
In fact, we wrap it in our own function, which we have in our development module, agaric:
function agaric_f($form_id, $form) {
drupal_set_message('<p>Form ID: ' . $form_id . '</p><pre>' . print_r($form, TRUE) . '</pre>');
}
This is a more... complete... overwhelming... version of the line Agaric suggested for displaying the form ID of all forms.
Also check out the Devel module, which has a setting to display form element IDs and weights. This might be a good in between, but Agaric asks "why do things halfway?"
Once we at Agaric are a little more sure that we know what we're doing, we will see if other developers are interested in having these little development-help functions put in a module like devel.
We assume a good Integrated Development Environment (IDE) would make this unnecessary, but some of us at Agaric and a lot of other developers too don't have an IDE they like.
To display everything about every form, Agaric uses this in a form_alter hook implementation:
drupal_set_message('<p>Form ID: ' . $form_id . '</p><pre>' . print_r($form, TRUE) . '</pre>');
In fact, we wrap it in our own function, which we have in our development module, agaric:
function agaric_f($form_id, $form) {
drupal_set_message('<p>Form ID: ' . $form_id . '</p><pre>' . print_r($form, TRUE) . '</pre>');
}
This is a more... complete... overwhelming... version of the line Agaric suggested for displaying the form ID of all forms.
Also check out the Devel module, which has a setting to display form element IDs and weights. This might be a good in between, but Agaric asks "why do things halfway?"
Once we at Agaric are a little more sure that we know what we're doing, we will see if other developers are interested in having these little development-help functions put in a module like devel.
We assume a good Integrated Development Environment (IDE) would make this unnecessary, but some of us at Agaric and a lot of other developers too don't have an IDE they like.
Comments
Post new comment