"Go to" with CodeIgniter


I'm new to PHPStorm, I was using Nebeans. Is there a way with PHPStorm to ctrl+click a function and directly open the file and put the cursor where the function is defined? I miss it, and now it says "Cannot find declaration to go to".



It does exactly that. 

But "Cannot find declaration to go to" indicates an issue in code resolve. That might be the case with CodeIgniter - this framework isn't officially supported yet. Feel free to vote for https://youtrack.jetbrains.com/issue/WI-1174


Below are a stack overflow post and a Github repo that I've found useful to provide solutions that don't require official IntelliJ IDEA (PHP plugin) or PhpStorm CodeIgniter framework support. Might not be ideal, but it is a huge improvement for me.

In my version of IDEA circa 2017, I didn't follow the more complicated "mark as plaintext" instructions and followed the less popular instructions in the stack overflow post that indicated: "Just drop the autocomplete.php file into the application/config folder and it works."

I used the CodeIgniter 3.0 for the repo as my base and added replaced the CI_Log and CI_Controller entries with my own My_Log and My_Controller entries for the $log and $controller variables. You may not have to do that but it solved a long-standing inability to autocomplete and navigate to the base classes with my IDE.




Please sign in to leave a comment.