# This routing.yml file makes both the fapi example description page and the
# included sample forms available at specific URL's on your site. A route
# maps a URL path to a controller. For page controllers it defines the
# function or method that will be called when the page is accessed.  For form
# controllers the content is determined by the buildForm method defined by the
# form controller implementation.

# Access to these paths is restricted to users with the permission
# 'access content'. This is notated as _permission: 'access content'.

# Menu items corresponding to these URLs are defined separately in the
# form_api_example.links.menu.yml file.
form_api_example.description:
  path: '/examples/form-api-example'
  defaults:
    _controller: '\Drupal\form_api_example\Controller\Page::description'
    _title: 'Form API Examples'
  requirements:
    _permission: 'access content'

form_api_example.simple_form:
  path: '/examples/form-api-example/simple-form'
  defaults:
    _form: '\Drupal\form_api_example\Form\SimpleForm'
    _title: 'Simple form'
  requirements:
    _permission: 'access content'

form_api_example.input_demo:
  path: '/examples/form-api-example/input-demo'
  defaults:
    _form: '\Drupal\form_api_example\Form\InputDemo'
    _title: 'Common input elements'
  requirements:
    _permission: 'access content'

form_api_example.state_demo:
  path: '/examples/form-api-example/state-demo'
  defaults:
    _form: '\Drupal\form_api_example\Form\StateDemo'
    _title: 'Form state binding'
  requirements:
    _permission: 'access content'

form_api_example.container_demo:
  path: '/examples/form-api-example/container-demo'
  defaults:
    _form: '\Drupal\form_api_example\Form\ContainerDemo'
    _title: 'Container elements'
  requirements:
    _permission: 'access content'

form_api_example.vertical_tabs_demo:
  path: '/examples/form-api-example/vertical-tabs-demo'
  defaults:
    _form: '\Drupal\form_api_example\Form\VerticalTabsDemo'
    _title: 'Vertical tab elements'
  requirements:
    _permission: 'access content'

form_api_example.modal_form:
  path: '/examples/form-api-example/modal-form/{nojs}'
  defaults:
    _form: '\Drupal\form_api_example\Form\ModalForm'
    _title: 'Modal form'
    nojs: ajax
  requirements:
    _permission: 'access content'

form_api_example.ajax_color_demo:
  path: '/examples/form-api-example/ajax-color-demo'
  defaults:
    _form: '\Drupal\form_api_example\Form\AjaxColorForm'
    _title: 'AJAX color form'
  requirements:
    _permission: 'access content'

form_api_example.build_demo:
  path: '/examples/form-api-example/build-demo'
  defaults:
    _form: '\Drupal\form_api_example\Form\BuildDemo'
    _title: 'Build form demo'
  requirements:
    _permission: 'access content'

form_api_example.ajax_add_more:
  path: '/examples/form-api-example/ajax-add-more'
  defaults:
    _form: '\Drupal\form_api_example\Form\AjaxAddMore'
    _title: 'Add-more button'
  requirements:
    _permission: 'access content'

form_api_example.ajax_add_remove_elements:
  path: '/examples/form-api-example/ajax-add-remove-elements'
  defaults:
    _form: '\Drupal\form_api_example\Form\AjaxAddRemoveElements'
    _title: 'AJAX add and remove elements'
  requirements:
    _permission: 'access content'

form_api_example.multistep_form:
  path: '/examples/form-api-example/multistep-form'
  defaults:
    _form: '\Drupal\form_api_example\Form\MultistepForm'
    _title: 'Multistep form'
  requirements:
    _permission: 'access content'
