function FormTestMachineNameValidationForm::load
Same name in other branches
- 9 core/modules/system/tests/modules/form_test/src/Form/FormTestMachineNameValidationForm.php \Drupal\form_test\Form\FormTestMachineNameValidationForm::load()
- 8.9.x core/modules/system/tests/modules/form_test/src/Form/FormTestMachineNameValidationForm.php \Drupal\form_test\Form\FormTestMachineNameValidationForm::load()
- 10 core/modules/system/tests/modules/form_test/src/Form/FormTestMachineNameValidationForm.php \Drupal\form_test\Form\FormTestMachineNameValidationForm::load()
Loading stub for machine name.
Parameters
string $machine_name: The machine name.
Return value
bool TRUE if the machine name is a duplicate, FALSE otherwise.
File
-
core/
modules/ system/ tests/ modules/ form_test/ src/ Form/ FormTestMachineNameValidationForm.php, line 131
Class
- FormTestMachineNameValidationForm
- Form to test whether machine name validation works with ajax requests.
Namespace
Drupal\form_test\FormCode
public function load($machine_name) {
if (str_contains($machine_name, 'duplicate')) {
return TRUE;
}
return FALSE;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.