PhpStorm 2018.2 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 PhpStorm basic ones.

Navigating to a Symfony symbol

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, etc.

ps navigate to symfony symbol

Navigating between related items

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

To navigate to a template rendered by a controller

  • Click the Twig icon twig icons twigFileIcon in the editor gutter.

    ps navigate to symfony twig

To navigate to a route mapped to a controller

  • Click the route icon ps symfony route icon in the editor gutter.

    ps navigate to symfony route

To navigate between multiple related items

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

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

    ps navigate to symfony related files chooser

To navigate from a related item back to a controller

  • Click icons nodes method svg in the editor gutter.

    ps navigate to symfony controller

Navigating to a template in a bundle

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

  1. In the main menu, choose Navigate | Go to File or press Ctrl+Shift+N.

  2. Type the bundle name and choose the desired Twig template contained in this bundle:

    ps navigate to symfony template bundle
Last modified: 21 November 2018