This repository contains helper files for code completion in phpStorm with CodeIgniter3 + HMVC.
CodeIgniter3: https://github.com/bcit-ci/CodeIgniter.git
HMVC: https://bitbucket.org/wiredesignz/codeigniter-modular-extensions-hmvc
Right-click on External Libraries
in the project explorer, and select Configure PHP Include Pahts
Adds the absolute path to where PhpStorm-CI/CodeCompletion
is located.
Windows:File > Settings > Directories > Add Content Root ,select the directory PhpStorm-CI/CodeCompletion
Mac: Preferences(comand+,)> Directories > Add Content Root ,select the directory PhpStorm-CI/CodeCompletion
Make CI's Controller and Model as Plain Text
- system/core/Controller.php
- system/core/Model.php
- application/third_party/MX/Controller.php (mx_controller)
Let the library and model available to code completion, you need add model and Library to the documentation block corresponding in the my_cc.php
.
/**
*
* ***************** YOUR MODELS *****************
* @property user_model $user_model
* @property log_sys_model $log_sys // load->model('log_sys_model', 'log_sys')
*
* ***************** YOUR LIBRARIES *****************
* @property Migrate $migrate Migrate Class
* @property global_functions $global_functions Common functions
*
*/
New My_class.php
in the libraries directory , and set to plain text; Then extends My_class in other libraries:
application/libraries/My_class.php
application/libraries/Log_Server.php
class Log_server extends My_class
{
}
- My_class.php 内容如下:
class My_class
{
}
- modify config/autoload.php:
$autoload['libraries'] = array('my_class');