PhpStorm 2024.2 Help

Forms

Most web applications contain one or more forms to collect user input. Symfony comes with a Form component and the FormBuilder functions that make creating and maintaining forms and their validation logic easier. The Symfony Support plugin provides code completion and navigation for forms.

Code completion and navigation in forms

PhpStorm provides code completion and code navigation for form type aliases, form options, and parameters. In the editor, press Ctrl+Space to invoke code completion for any of the following:

  • Use code completion for the registered form type aliases.

    Symfony form builder field name completion
  • Specify the fields' options.

    Symfony form builder field parameters completion
  • Specify translation keys and domains in applications that require internationalization and make use of the Translation component.

    Symfony form builder translations completion

To navigate to the declaration of a field, place the caret at its usage and press Ctrl+B or, alternatively, Ctrl+Click the usage.

Last modified: 17 June 2024