IntelliJ IDEA 2023.1 Help

Navigating Through a Symfony Project

Symfony introduces a number of concepts that are important for an application, including but not limited to controllers (actions), routing, templating, the Doctrine ORM, testing, forms, translations, services, bundles, and configuration. Developing a Symfony application means integrating some (or all) of these components together, often switching back and forth between different files and artifact types.

To facilitate this, the Symfony Plugin provides several extra code navigation features in addition to the IntelliJ IDEA basic ones.

Install the required plugins

This functionality relies on the PHP, Symfony Support, and PHP Annotations plugins that should be installed and enabled in your IDE.

The plugins are available only in IntelliJ IDEA Ultimate.

  1. Press Ctrl+Alt+S to open the IDE settings and select Plugins.

  2. Switch to the Marketplace tab and use the search field to find the plugins.

  3. Click Install next to each plugin and restart the IDE if prompted.

The Symfony Plugin adds a Symfony Symbol command under the Navigate main menu item. It lets you navigate to any Symfony symbol in your project: a controller, a template, a route, an entity, and so on.

Navigate to Symfony symbol

For controllers, the Symfony Plugin adds a set of icons to the editor gutter, which let you navigate between related items.

  • Click the Twig icon the Twig icon in the editor gutter.

    Navigate to Template
  • Click the route icon the Symfony route icon in the editor gutter.

    Navigate to Symfony route

If multiple related items are found (for example, both a Twig template and a related route), the related files icon the Symfony related files icon is displayed.

  • Click the icon in the editor gutter and choose the item to navigate to from the popup menu:

    Navigate to Symfony related files
  • Click the Method icon in the editor gutter.

    Navigate to Symfony controller

With basic support for bundles, you can navigate to a Twig template contained in a bundle.

Last modified: 01 August 2022