Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$this->render('xxxxxx') -> cannot find declaration to go to on (symfony 2.8) #2239

Open
alpium opened this issue Oct 12, 2023 · 4 comments
Open

Comments

@alpium
Copy link

alpium commented Oct 12, 2023

Hi,

One of my project is still in symfony 2 ..., and since severals weeks, unable to navigate on the routes with the render method : $this->render('myview...');

When CTRL + click on myview , i always have the message : cannot find declaration to go to
On an other project with symfony 5, it works perfectly ...

Plugin version : 2022.1.258 (full version)
PhpStorm version : 2023.2.2 (last)

It was ok before an update, i don't know if it's a PHPStorm update or a plugin update.

I tried to delete .idea/workspace.xml, I try to delete .idea/symfony2.xml

I note in the plugin / routing / parameters, if i click on "reset to default"

There is a list of path with are alls NOT FOUND
Ex : app/cache/dev/appDevUrlGenerator.php NOT FOUND
... all NOT FOUND

In my directory I have :
app/cache/dev/appDevDebugProjectContainerUrlGenerator.php
app/cache/dev/appDevDebugProjectContainerUrlMatcher.php

So i tried to install mannually this 2 path and restart the IDE
so i have :
app/cache/dev/appDevDebugProjectContainerUrlGenerator.php EXISTS
app/cache/dev/appDevDebugProjectContainerUrlMatcher.php EXISTS

but this not resolve the CTRL + Click navigation on Renders ...

Navigation CTRL + Click works well for :
function navigation, Routing Yml file to Controller, $this->generateUrl( ...

But not for the Render at end of a controller function ...

Any Idea ?

Thanks,

Mike

@alpium
Copy link
Author

alpium commented Oct 16, 2023

Complement :
The @ annotion works well : $this->render('@Controller/path/page.html.twig' ...
Ctrl click : link is blue and open the page.html.twig.

The classic annotation don't work any more : $this->render('ChaletmontagneAdminLoueurNewBundle:Biens/planning
Ctrl click : do nothing, no blue colocation and no page open.

thanks .

Mike

@Phobetor
Copy link

Phobetor commented Nov 15, 2023

I updated my whole project to the @ syntax to work around this.

In case someone else also likes to do that here is my regular expression replace:

Search: AcmeBundle:(.+)\:(.+\.twig)
Replace: @Acme/$1/$2 (consider that there is no "Bundle" keyword anymore)

@Haehnchen
Copy link
Owner

Haehnchen commented Apr 1, 2024

you can also enable this "legacy feature":

image

@alpium
Copy link
Author

alpium commented Apr 4, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants