PhpStorm to configure CodeIgniter(CI) Code intelligent prompt automatic completion of framework

Pain point

* PhpStorm It's not in it CI Auto prompt for frames ,model It's crazy to find a way ?($this->load There was no more to follow )
* model There is no automatic prompt for the method of , Every time you compare it model Structure diagram .($this->xxx_model-> There was no more to follow )
* Effect to be achieved : PhpStorm support CI Various writing formats , Improve development efficiency .
Solutions

Using annotated @property To map the corresponding class
@property Class name Real name
Take a chestnut
realization model Custom class this->db Chain prompt
Model Of this->db Chain prompt , We are here custom model class Add the corresponding @property Note assignment CI_DB_query_builder Class
/** * @property CI_DB_query_builder $db */ class Orderqueue_model extends
MY_Model { } realization library Custom class Tips
The custom code will be placed in the libraries inside , And it will be placed in a separate subfolder . So how to prompt the user-defined class code ? Follow model It's the same ,@property Note assignment
CI_Queue Class
/** * Class Queue * @property CI_Queue $queue */ class Queue extends
AdminController { protected $max_num = 5; public function __construct() {
parent::__construct(); $this->load->library('Queue', '', 'queue');
$this->queue->get_list();// Will automatically prompt } }
summary

There are more ways to spread it online , First from Git Download class files written by others , And then in your project's External Libraries Right up ->Configure PHP
Include Path, next Make as Plain Text
. I don't recommend it , It's not that hard , It's a very simple step , add to @property The annotation specifies the file .

Technology