How to configure phpstorm to perfectly support Codeigniter code completion
This article mainly introduces "how to configure phpstorm to support Codeigniter code completion perfectly". In daily operation, I believe many people have doubts about how to configure phpstorm to support Codeigniter code completion perfectly. Xiaobian consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the questions of "how to configure phpstorm to support Codeigniter code completion perfectly". Next, please follow the editor to study!
1. Set font and style
The code theme selection Monokai will be the color code.
2. Configure CI code hints
Download the code hint project:
Https://github.com/topdown/phpStorm-CC-Helpers
Copy prompt snippet:
Copy CI_phpStorm.php,DB_active_rec.php (renamed to DB_query_builder.php) and my_models.php to the root directory of the website, that is, index.php in the same directory.
Set the CI core class to plain text:
Set the core/Controller.php,core/Model.php,database/DB_query_builder.php right in system to plain text.
Now there is a code completion function.
Implement the model prompt function:
Add the Model class to the comments in my_models.php, and note that the first letter of the class name is changed from uppercase to lowercase. So Model can hint.
Implement the view prompt:
The corresponding controller class needs to implement the _ _ toString () method, and that's fine.
Hold down the left mouse button of ctrl+ and you can see which class he comes from (ctrl+q displays comments). If you click on the function name, you can navigate to that function.
Model subfolder
Create a folder in model, such as a model class: mod/Test1_model.php.
Also add comments to my_models.php, but ignore the mod folder, as if it doesn't exist:
@ property test1_model $test1_model
But in the code load, this folder should be reflected, so that it will not affect the code hint:
$this- > load- > model ('mod/test1_model')
$data ['news2'] = $this- > test1_model- > getData ()
Implement the library custom class prompt function
The custom code will be placed in libraries and in a separate subfolder. Because this code may be reused, this subfolder will be used as a separate git, while other code is unlikely to be reused, adhering to the unique business logic of this site, regardless of reuse. So how does this custom code do code hints? It's the same as model:
@ property Testzphp
$testzphp
Then in controller:
$this- > load- > library ('zphp/Testzphp')
$data ['zphp'] = $this- > testzphp- > test (235)
3. Git configuration
Add .idea to the ignore list.
4. Remove the spell check
Uncheck project settings-- > inspections-> spelling-> Typo
5. Shortcut keys
Fast navigation
When navigating to the corresponding class-method through the code to view the source code, you need to be able to return quickly: ctrl+alt+ left arrow / right arrow
At this point, the study on "how to configure phpstorm to perfectly support Codeigniter code completion" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!