我的config目录中有一个autocomplete.php
文件。自动填充功能可以在库文件中除之外的任何地方使用。以下是问题的一个示例:
class Some_custom_lib {
protected $CI;
public function __construct() {
$this->CI =& get_instance();
$this->CI->load->model('some_custom_model');
}
public function createSubrofile($post_vars) {
return $this->CI->some_custom_model->create_file($post_vars); <-- This will not autocomplete.
}
要清楚,这是一个CodeIgniter库文件,它位于applications / libraries文件夹中并加载了$this->load->library('Some_custom_lib');
如何使用PhpStorm在CodeIgniter库文件中使用自动完成功能?
答案 0 :(得分:0)
感谢在CodeIgniter论坛上发表了一张亲切的海报,我找到了搜索这个帖子的人的答案。您需要做的就是添加
/*
* @property CI_Controller $CI
*/
到图书馆的顶部。