1 form_test.module | form_test_load_include_custom($form, &$form_state) |
Menu callback for testing custom form includes.
File
- core/
modules/ simpletest/ tests/ form_test.module, line 2439 - Helper module for the Form API tests.
Code
function form_test_load_include_custom($form, &$form_state) {
$form['button'] = array(
'#type' => 'submit',
'#value' => t('Save'),
'#submit' => array('form_test_load_include_submit'),
);
// Specify the include file and enable form caching. That way the form is
// cached when it is submitted, but needs to find the specified submit handler
// in the include.
// Filename is a bit weird here: modules/simpletest/tests/form_test.file.inc
form_load_include($form_state, 'inc', 'form_test', 'form_test.file');
$form_state['cache'] = TRUE;
return $form;
}