Classes, traits, and interfaces - main - drupal

Primary tabs

Introduction to classes

A lot of the PHP code in Drupal is object oriented (OO), making use of PHP classes, interfaces, and traits. See the Objected-oriented programming conventions for more information.

See also

Objected-oriented programming conventions

File

core/core.api.php, line 1529

Name Deprecated Object type Namespace File name Summary Direct uses Use statements Strings
FormTestGetForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestGetForm.php Form to test whether GET forms have a CSRF token. 1
FormTestGroupContainerForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestGroupContainerForm.php Builds a simple form to test the #group property on #type 'container'. 1
FormTestGroupDetailsForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestGroupDetailsForm.php Builds a simple form to test the #group property on #type 'details'. 1
FormTestGroupFieldsetForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestGroupFieldsetForm.php Builds a simple form to test the #group property on #type 'fieldset'. 1
FormTestGroupVerticalTabsForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestGroupVerticalTabsForm.php Builds a simple form to test the #group property on #type 'vertical_tabs'. 1
FormTestHooks class Drupal\form_test\Hook core/modules/system/tests/modules/form_test/src/Hook/FormTestHooks.php Hook implementations for form_test.
FormTestInputForgeryForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestInputForgeryForm.php Form to test input forgery. 1
FormTestLabelForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestLabelForm.php A form for testing form labels and required marks. 1 1
FormTestLanguageSelectForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestLanguageSelectForm.php Builds a form to test the language select form element. 1
FormTestLimitValidationErrorsForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestLimitValidationErrorsForm.php Builds a simple form with a button triggering partial validation. 1
FormTestMachineNameForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestMachineNameForm.php Form constructor for testing #type 'machine_name' elements. 1
FormTestMachineNameValidationForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestMachineNameValidationForm.php Form to test whether machine name validation works with ajax requests. 1
FormTestMiddleware class Drupal\form_test\StackMiddleware core/modules/system/tests/modules/form_test/src/StackMiddleware/FormTestMiddleware.php Provides a test middleware which sets a custom response header. 2
FormTestNumberForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestNumberForm.php Builds a form to test #type 'number' and 'range' validation. 1
FormTestObject class Drupal\form_test core/modules/system/tests/modules/form_test/src/FormTestObject.php Provides a test form object. 2 1
FormTestOptionalContainerForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestOptionalContainerForm.php Builds a simple form to test the #optional property on #type 'container'. 1
FormTestPatternForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestPatternForm.php Builds a simple form using the FAPI #pattern property. 1
FormTestPlaceholderForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestPlaceholderForm.php Builds a form to test the placeholder attribute. 1
FormTestProgrammaticForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestProgrammaticForm.php Form builder to test programmatic form submissions.
FormTestRadiosCheckedForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestRadiosCheckedForm.php Form constructor to test #default_value settings of radios. 1
FormTestRangeForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestRangeForm.php Form constructor for testing #type 'range' elements. 1
FormTestRangeInvalidForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestRangeInvalidForm.php Form constructor for testing invalid #type 'range' elements. 1
FormTestRebuildPreserveValuesForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestRebuildPreserveValuesForm.php Form builder for testing preservation of values during a rebuild. 1
FormTestRecipeInputForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestRecipeInputForm.php Form to test recipe input functionality. 1
FormTestRedirectForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestRedirectForm.php Form builder to detect form redirect. 1
FormTestRequiredAttributeForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestRequiredAttributeForm.php Builds a form to test the required attribute. 1
FormTestResponseForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestResponseForm.php Form constructor for testing #type 'url' elements. 1
FormTestSelectForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestSelectForm.php Builds a form to test #type 'select' validation. 1
FormTestServiceObject class Drupal\form_test core/modules/system/tests/modules/form_test/src/FormTestServiceObject.php Provides a test form object. 2
FormTestStatePersistForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestStatePersistForm.php Form constructor for testing form state persistence. 1
FormTestStorageForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestStorageForm.php A multistep form for testing the form storage. 1
FormTestStoragePageCacheForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestStoragePageCacheForm.php Form to test page cache storage. 1
FormTestSubmitButtonAttributeForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestSubmitButtonAttributeForm.php Builds a simple form to test the submit_button attribute. 1
FormTestTableForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestTableForm.php Form constructor for testing #type 'table' elements.
FormTestTableSelectColspanForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestTableSelectColspanForm.php Builds a form to test table selects with different column spans. 1
FormTestTableSelectDisabledRowsForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestTableSelectDisabledRowsForm.php Builds a form to test table select with disabled rows. 1
FormTestTableSelectEmptyForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestTableSelectEmptyForm.php Builds a form to test table select with '#options' set to empty. 1
FormTestTableSelectFormBase abstract class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestTableSelectFormBase.php Provides a base class for tableselect forms. 7
FormTestTableSelectJsSelectForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestTableSelectJsSelectForm.php Builds a form to test table select with JS. 1
FormTestTableSelectMultipleFalseForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestTableSelectMultipleFalseForm.php Builds a form to test table select with '#multiple" set to FALSE. 1
FormTestTableSelectMultipleTrueForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestTableSelectMultipleTrueForm.php Builds a form to test table select with '#multiple' as TRUE. 1
FormTestTextareaForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestTextareaForm.php Form for testing textarea. 1
FormTestUrlForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestUrlForm.php Form constructor for testing #type 'url' elements. 1
FormTestValidateForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestValidateForm.php Form builder for testing \Drupal\Core\Form\FormValidatorInterface::validateForm(). 1
FormTestValidateNoToken class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestValidateNoToken.php Form to test the validation of forms with a disabled CSRF token. 1
FormTestValidateRequiredForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestValidateRequiredForm.php Form constructor to test the #required property. 1
FormTestValidateRequiredNoTitleForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestValidateRequiredNoTitleForm.php Form constructor to test the #required property without #title. 1
FormTestVerticalTabsAccessForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestVerticalTabsAccessForm.php Builds a form to test vertical tabs access. 1
FormTestVerticalTabsForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestVerticalTabsForm.php Builds a simple form to test vertical tabs. 1
FormTestVerticalTabsWithSummaryForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestVerticalTabsWithSummaryForm.php Builds a simple form to test vertical-tabs form element with tab summaries. 1

Other projects


Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.