Skip to content

Commit 54e4179

Browse files
navneet0693paul-m
authored andcommitted
Issue #2840529 by navneet0693, eojthebrave, Torenware, andypost: Reordering the sub-demos for Form API Example
1 parent 9173b8f commit 54e4179

File tree

4 files changed

+58
-48
lines changed

4 files changed

+58
-48
lines changed

fapi_example/fapi_example.links.menu.yml

Lines changed: 31 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,55 +5,64 @@ fapi_example.description:
55
route_name: fapi_example.description
66

77
fapi_example.simple_form:
8-
title: Simple Form API Example
8+
title: Simple Form
99
description: A simple form example with submit processing.
1010
route_name: fapi_example.simple_form
1111
parent: fapi_example.description
12+
weight: -9
13+
14+
fapi_example.multistep_form:
15+
title: Multistep Form
16+
description: Multistep form example with submit processing.
17+
route_name: fapi_example.multistep_form
18+
parent: fapi_example.description
19+
weight: -8
1220

1321
fapi_example.input_demo:
14-
title: Demo of Common Input Elements
22+
title: Common Input Elements
1523
description: A form to demonstrate input elements.
1624
route_name: fapi_example.input_demo
1725
parent: fapi_example.description
26+
weight: -7
1827

19-
fapi_example.state_demo:
20-
title: Demo of Form State Binding
21-
description: A form to demonstrate binding of form state.
22-
route_name: fapi_example.state_demo
28+
fapi_example.build_demo:
29+
title: Build Form Demo
30+
description: Demonstrates the order of firing of from controller methods.
31+
route_name: fapi_example.build_demo
2332
parent: fapi_example.description
33+
weight: -6
2434

2535
fapi_example.container_demo:
26-
title: Container Demo
36+
title: Container Elements
2737
description: A form to demonstrate use of containers.
2838
route_name: fapi_example.container_demo
2939
parent: fapi_example.description
40+
weight: -5
41+
42+
fapi_example.state_demo:
43+
title: Form State Binding
44+
description: A form to demonstrate binding of form state.
45+
route_name: fapi_example.state_demo
46+
parent: fapi_example.description
47+
weight: -4
3048

3149
fapi_example.vertical_tabs_demo:
32-
title: VerticalTabs Demo
50+
title: Vertical Tab Elements
3351
description: A form to demonstrate use of vertical tabs.
3452
route_name: fapi_example.vertical_tabs_demo
3553
parent: fapi_example.description
54+
weight: -3
3655

3756
fapi_example.ajax_demo:
38-
title: Ajax Form Example
57+
title: Ajax Form
3958
description: A form to demonstrate use of AJAX.
4059
route_name: fapi_example.ajax_demo
4160
parent: fapi_example.description
42-
43-
fapi_example.build_demo:
44-
title: Build Form Demo
45-
description: Demonstrates the order of firing of from controller methods.
46-
route_name: fapi_example.build_demo
47-
parent: fapi_example.description
61+
weight: -2
4862

4963
fapi_example.ajax_addmore:
50-
title: Ajax Add more button
64+
title: Add-more Button
5165
description: Form with 'add more' and 'remove' buttons.
5266
route_name: fapi_example.ajax_addmore
5367
parent: fapi_example.description
54-
55-
fapi_example.multistep_form:
56-
title: Multistep Form API Example
57-
description: Multistep form example with submit processing.
58-
route_name: fapi_example.multistep_form
59-
parent: fapi_example.description
68+
weight: -1

fapi_example/fapi_example.module

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,25 @@
1919
* \Drupal::formBuilder()->getForm()
2020
* - fapi_example.routing.yml
2121
*
22-
* In addition to the simple example described above this module provides
22+
* In addition to the simple example described above this module provides
2323
* examples that demonstrate:
24+
* - Elements used for data input
25+
* -\Drupal\fapi_example\Form\InputDemo
2426
* - The order of execution of form controller methods
2527
* - \Drupal\fapi_example\Form\BuildDemo
26-
* - Populating a portion on a form with Ajax callbacks
27-
* - \Drupal\fapi_example\Form\AjaxDemo
2828
* - Container elements used to group items
2929
* - \Drupal\fapi_example\Form\ContainerDemo
30-
* - Elements used for data input
31-
* - \Drupal\fapi_example\Form\InputDemo
32-
* - Modal form creation
33-
* - \Drupal\fapi_example\Controller\Page
34-
* - \Drupal\fapi_example\Form\ModalForm
3530
* - Hiding elements based on the state of other elements
3631
* - \Drupal\fapi_example\Form\StateDemo
3732
* - Vertical Tabs elements in forms
3833
* - \Drupal\fapi_example\Form\VerticalTabsDemo
34+
* - Populating a portion on a form with Ajax callbacks
35+
* - \Drupal\fapi_example\Form\AjaxDemo
36+
* - Adding additional fields to a form with Ajax callbacks
37+
* - \Drupal\fapi_example\Form\AjaxAddMore
38+
* - Modal form creation
39+
* - \Drupal\fapi_example\Controller\Page
40+
* - \Drupal\fapi_example\Form\ModalForm
3941
*
4042
* @} End of "defgroup field_example".
4143
*/

fapi_example/fapi_example.routing.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,55 +22,55 @@ fapi_example.simple_form:
2222
path: 'examples/fapi-example/simple-form'
2323
defaults:
2424
_form: '\Drupal\fapi_example\Form\SimpleForm'
25-
_title: 'Simple Form API Example'
25+
_title: 'Simple Form'
2626
requirements:
2727
_permission: 'access content'
2828

2929
fapi_example.input_demo:
3030
path: 'examples/fapi-example/input-demo'
3131
defaults:
3232
_form: '\Drupal\fapi_example\Form\InputDemo'
33-
_title: 'Demo of Common Input Elements'
33+
_title: 'Common Input Elements'
3434
requirements:
3535
_permission: 'access content'
3636

3737
fapi_example.state_demo:
3838
path: 'examples/fapi-example/state-demo'
3939
defaults:
4040
_form: '\Drupal\fapi_example\Form\StateDemo'
41-
_title: 'Demo of Form State Binding'
41+
_title: 'Form State Binding'
4242
requirements:
4343
_permission: 'access content'
4444

4545
fapi_example.container_demo:
4646
path: 'examples/fapi-example/container-demo'
4747
defaults:
4848
_form: '\Drupal\fapi_example\Form\ContainerDemo'
49-
_title: 'Container Demo'
49+
_title: 'Container Elements'
5050
requirements:
5151
_permission: 'access content'
5252

5353
fapi_example.vertical_tabs_demo:
5454
path: 'examples/fapi-example/vertical-tabs-demo'
5555
defaults:
5656
_form: '\Drupal\fapi_example\Form\VerticalTabsDemo'
57-
_title: 'VerticalTabs Demo'
57+
_title: 'Vertical Tab Elements'
5858
requirements:
5959
_permission: 'access content'
6060

6161
fapi_example.modal_form:
6262
path: 'examples/fapi-example/modal-form'
6363
defaults:
6464
_form: '\Drupal\fapi_example\Form\ModalForm'
65-
_title: 'Modal Form Example'
65+
_title: 'Modal Form'
6666
requirements:
6767
_permission: 'access content'
6868

6969
fapi_example.ajax_demo:
7070
path: 'examples/fapi-example/ajax-demo'
7171
defaults:
7272
_form: '\Drupal\fapi_example\Form\AjaxDemo'
73-
_title: 'Ajax Form Example'
73+
_title: 'Ajax Form'
7474
requirements:
7575
_permission: 'access content'
7676

@@ -86,14 +86,14 @@ fapi_example.ajax_addmore:
8686
path: 'examples/fapi-example/ajax-addmore'
8787
defaults:
8888
_form: '\Drupal\fapi_example\Form\AjaxAddMore'
89-
_title: 'Add-more button'
89+
_title: 'Add-more Button'
9090
requirements:
9191
_permission: 'access content'
9292

9393
fapi_example.multistep_form:
9494
path: 'examples/fapi-example/multistep-form'
9595
defaults:
9696
_form: '\Drupal\fapi_example\Form\MultistepForm'
97-
_title: 'Multistep Form Example'
97+
_title: 'Multistep Form'
9898
requirements:
9999
_permission: 'access content'

fapi_example/src/Controller/Page.php

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,17 @@ public function description() {
2626
'#items' => [
2727
Link::createFromRoute($this->t('Simple Form'), 'fapi_example.simple_form'),
2828
Link::createFromRoute($this->t('Multistep Form'), 'fapi_example.multistep_form'),
29-
Link::createFromRoute($this->t('Input Demo'), 'fapi_example.input_demo'),
30-
Link::createFromRoute($this->t('Form State Example'), 'fapi_example.state_demo'),
31-
Link::createFromRoute($this->t('Container Demo'), 'fapi_example.container_demo'),
32-
Link::createFromRoute($this->t('Vertical Tab Demo'), 'fapi_example.vertical_tabs_demo'),
33-
Link::createFromRoute($this->t('Ajax Demo'), 'fapi_example.ajax_demo'),
29+
Link::createFromRoute($this->t('Common Input Elements'), 'fapi_example.input_demo'),
30+
Link::createFromRoute($this->t('Build Form Demo'), 'fapi_example.build_demo'),
31+
Link::createFromRoute($this->t('Container Elements'), 'fapi_example.container_demo'),
32+
Link::createFromRoute($this->t('Form State Binding'), 'fapi_example.state_demo'),
33+
Link::createFromRoute($this->t('Vertical Tab Elements'), 'fapi_example.vertical_tabs_demo'),
34+
Link::createFromRoute($this->t('Ajax Form'), 'fapi_example.ajax_demo'),
35+
Link::createFromRoute($this->t('Add-more Button'), 'fapi_example.ajax_addmore'),
3436

3537
// Attributes are used by the core dialog libraries to invoke the modal.
3638
Link::createFromRoute(
37-
$this->t('Modal Example'),
39+
$this->t('Modal Form'),
3840
'fapi_example.modal_form',
3941
[],
4042
[
@@ -44,9 +46,6 @@ public function description() {
4446
],
4547
]
4648
),
47-
48-
Link::createFromRoute($this->t('Build Demo'), 'fapi_example.build_demo'),
49-
Link::createFromRoute($this->t('Ajax Add More Demo'), 'fapi_example.ajax_addmore'),
5049
],
5150
];
5251

0 commit comments

Comments
 (0)