diff --git a/fapi_example/fapi_example.links.menu.yml b/fapi_example/fapi_example.links.menu.yml index 95c338a..63a8695 100644 --- a/fapi_example/fapi_example.links.menu.yml +++ b/fapi_example/fapi_example.links.menu.yml @@ -9,45 +9,53 @@ fapi_example.simple_form: description: A simple form example with submit processing. route_name: fapi_example.simple_form parent: fapi_example.description + weight: -8 fapi_example.input_demo: title: Demo of Common Input Elements description: A form to demonstrate input elements. route_name: fapi_example.input_demo parent: fapi_example.description + weight: -7 -fapi_example.state_demo: - title: Demo of Form State Binding - description: A form to demonstrate binding of form state. - route_name: fapi_example.state_demo +fapi_example.build_demo: + title: Build Form Demo + description: Demonstrates the order of firing of from controller methods. + route_name: fapi_example.build_demo parent: fapi_example.description + weight: -6 fapi_example.container_demo: title: Container Demo description: A form to demonstrate use of containers. route_name: fapi_example.container_demo parent: fapi_example.description + weight: -5 + +fapi_example.state_demo: + title: Demo of Form State Binding + description: A form to demonstrate binding of form state. + route_name: fapi_example.state_demo + parent: fapi_example.description + weight: -4 fapi_example.vertical_tabs_demo: - title: VerticalTabs Demo + title: Vertical Tabs Demo description: A form to demonstrate use of vertical tabs. route_name: fapi_example.vertical_tabs_demo parent: fapi_example.description + weight: -3 fapi_example.ajax_demo: title: Ajax Form Example description: A form to demonstrate use of AJAX. route_name: fapi_example.ajax_demo parent: fapi_example.description - -fapi_example.build_demo: - title: Build Form Demo - description: Demonstrates the order of firing of from controller methods. - route_name: fapi_example.build_demo - parent: fapi_example.description + weight: -2 fapi_example.ajax_addmore: title: Ajax Add more button description: Form with 'add more' and 'remove' buttons. route_name: fapi_example.ajax_addmore parent: fapi_example.description + weight: -1 diff --git a/fapi_example/fapi_example.module b/fapi_example/fapi_example.module index e0bdd08..73efb40 100644 --- a/fapi_example/fapi_example.module +++ b/fapi_example/fapi_example.module @@ -19,23 +19,25 @@ * \Drupal::formBuilder()->getForm() * - fapi_example.routing.yml * - * In addition to the simple example described above this module provides + * In addition to the simple example described above this module provides * examples that demonstrate: + * - Elements used for data input + * -\Drupal\fapi_example\Form\InputDemo * - The order of execution of form controller methods - * - \Drupal\fapi_example\Form\BuildDemo + * -\Drupal\fapi_example\Form\BuildDemo + * - Container elements used to group items + * -\Drupal\fapi_example\Form\ContainerDemo + * - Hiding elements based on the state of other elements + * -\Drupal\fapi_example\Form\StateDemo + * - Vertical Tabs elements in forms + * - \Drupal\fapi_example\Form\VerticalTabsDemo * - Populating a portion on a form with Ajax callbacks * - \Drupal\fapi_example\Form\AjaxDemo - * - Container elements used to group items - * - \Drupal\fapi_example\Form\ContainerDemo - * - Elements used for data input - * - \Drupal\fapi_example\Form\InputDemo + * - Adding additional fields to a form with Ajax callbacks + * - \Drupal\fapi_example\Form\AjaxAddMore * - Modal form creation * - \Drupal\fapi_example\Controller\Page * - \Drupal\fapi_example\Form\ModalForm - * - Hiding elements based on the state of other elements - * - \Drupal\fapi_example\Form\StateDemo - * - Vertical Tabs elements in forms - * - \Drupal\fapi_example\Form\VerticalTabsDemo * * @} End of "defgroup field_example". */ diff --git a/fapi_example/src/Controller/Page.php b/fapi_example/src/Controller/Page.php index a9308aa..7bc3e87 100644 --- a/fapi_example/src/Controller/Page.php +++ b/fapi_example/src/Controller/Page.php @@ -28,10 +28,12 @@ class Page extends ControllerBase { '#items' => [ Link::createFromRoute($this->t('Simple Form'), 'fapi_example.simple_form'), Link::createFromRoute($this->t('Input Demo'), 'fapi_example.input_demo'), - Link::createFromRoute($this->t('Form State Example'), 'fapi_example.state_demo'), + Link::createFromRoute($this->t('Build Demo'), 'fapi_example.build_demo'), Link::createFromRoute($this->t('Container Demo'), 'fapi_example.container_demo'), + Link::createFromRoute($this->t('Form State Example'), 'fapi_example.state_demo'), Link::createFromRoute($this->t('Vertical Tab Demo'), 'fapi_example.vertical_tabs_demo'), Link::createFromRoute($this->t('Ajax Demo'), 'fapi_example.ajax_demo'), + Link::createFromRoute($this->t('Ajax Add More Demo'), 'fapi_example.ajax_addmore'), // Attributes are used by the core dialog libraries to invoke the modal. Link::createFromRoute( @@ -45,9 +47,6 @@ class Page extends ControllerBase { ], ] ), - - Link::createFromRoute($this->t('Build Demo'), 'fapi_example.build_demo'), - Link::createFromRoute($this->t('Ajax Add More Demo'), 'fapi_example.ajax_addmore'), ], ];