How To Integrate Source Code Navigation Of CodeIgniter In PHPStorm

If you have used or using PHPStrom and you have worked on CodeIgniter project, then must be knowing  that in PHPStrom there is no source code navigation for the CodeIgniter library.

In this article I will let you know about the easy and simple ways of adding the source code navigation for CodeIgniter.

Create a phpstorm.php file as i have attached it with this article. And  follow the below steps :-

  1. Put it in the root of your CodeIgniter project.
  2. In PhpStorm’s Project View panel, go to (expand)  system/core/.
  3. Right click on Controller.php and choose Mark as Plain Text.
  4. Do the same for Model.php for the model navigation .

CUSTOM CODE NAVIGATION

Now suppose  you have to add your functions in the source code navigation. Then its very easy to do so .

If you read the whole file you will find there are three section – Libraries, Controllers and Models.

To enable your own custom function either of controller or of model, in the same phpstorm.php file add the name of the class of your controller  in the libraries section and then add the controller class name in the controller section to add the controller. To add the model add it in libraries as well as model section.  In both the case either of controller or model , you have to compulsorily add it in libraries section.

Let us suppose you have to add controller (Recommend_panel) in your phpstorm.php.

See in the below  code of phpstorm file i have highlighted the customised line in libraries and controller,  both sections. Add first column as the class name of the controller , in second column give the variable name for your controller and in the third column give the single line explanation of library.

See the customised file :-

 

 

After adding these two lines you can see that your controller class and their function is appearing in the navigation. You can do it same for model class.

NOTE –  Please find the attached file as core phpstorm file for codeigniter source code navigation – phpstorm.php

Please follow and like us:
20