X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fsystem%2Ftests%2Fmodules%2Fform_test%2Fsrc%2FForm%2FFormTestOptionalContainerForm.php;fp=web%2Fcore%2Fmodules%2Fsystem%2Ftests%2Fmodules%2Fform_test%2Fsrc%2FForm%2FFormTestOptionalContainerForm.php;h=063f03a461c6bd8c44e3a7eb04ce3a464180619f;hp=0000000000000000000000000000000000000000;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0 diff --git a/web/core/modules/system/tests/modules/form_test/src/Form/FormTestOptionalContainerForm.php b/web/core/modules/system/tests/modules/form_test/src/Form/FormTestOptionalContainerForm.php new file mode 100644 index 000000000..063f03a46 --- /dev/null +++ b/web/core/modules/system/tests/modules/form_test/src/Form/FormTestOptionalContainerForm.php @@ -0,0 +1,62 @@ + 'container', + '#attributes' => ['class' => ['empty_optional']], + '#optional' => TRUE, + ]; + $form['empty_nonoptional'] = [ + '#type' => 'container', + '#attributes' => ['class' => ['empty_nonoptional']], + '#optional' => FALSE, + ]; + + // Non-empty containers + $form['nonempty_optional'] = [ + '#type' => 'container', + '#attributes' => ['class' => ['nonempty_optional']], + '#optional' => TRUE, + ]; + $form['nonempty_optional']['child_1'] = []; + + $form['nonempty_nonoptional'] = [ + '#type' => 'container', + '#attributes' => ['class' => ['nonempty_nonoptional']], + '#optional' => FALSE, + ]; + $form['nonempty_nonoptional']['child_2'] = []; + + return $form; + } + + /** + * {@inheritdoc} + */ + public function submitForm(array &$form, FormStateInterface $form_state) { + } + +}