PhpStorm
裏面沒有CI框架的自動提示,model
找方法很抓狂?($this->load
以後再無下文)model
的方法沒有自動提示,每次都要對照着model
結構圖來寫。($this->xxx_model->
以後再無下文)PhpStorm
支持CI
的各類書寫格式,提升開發效率。利用註釋的 @property
來映射對應的類框架
@property 類名 實列名
實現 model自定義類 this->db
鏈式提示提示
Model
的 this->db
鏈式提示,咱們在 自定義model類
添加相應的@property
註釋指定 CI_DB_query_builder
類便可ui
/** * @property CI_DB_query_builder $db */ class Orderqueue_model extends MY_Model { }
實現 library自定義類
提示
自定義代碼會放在libraries
裏面,而且會放在一個單獨的子文件夾裏。那麼這種自定義類代碼如何作代碼提示?跟model是同樣的,@property
註釋指定 CI_Queue
類便可this
/** * 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();// 會自動提示 } }
網上流傳的更多方法的是,先從Git
下載別人寫好的類文件,而後在你項目的External Libraries
上右鍵->Configure PHP Include Path
,接下來 Make as Plain Text
。本人不建議採納這樣作,其實沒這麼費勁,很簡單的一步到位,添加@property註解指定文件就能夠啦。code