Code Completion for Codeigniter with PhpStorm
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
CodeCompletion
README-cn.md
README.md

README.md

中文说明

Code Completion for CodeIgniter3 & HMVC projects in PHPStorm

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

Installation

Method 1: set up Include Paths

Right-click on External Libraries in the project explorer, and select Configure PHP Include Pahts

s

Adds the absolute path to where PhpStorm-CI/CodeCompletion is located.

s

Method 2: set up Content Root

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

s

CodeIgniter Specific

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
 *
 */

Code Completion in Library(Option)

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');

Preview

ScreenShot

s s

Origin Repo : https://github.com/topdown/phpStorm-CC-Helpers