PHP8.1.21版本已发布
vue8.1.21版本已发布
jquery8.1.21版本已发布

让phpstrom支持codeigniter框架实现 (GO TO )转到定义的功能

原创
2016-06-23 13:17:01 720浏览

2016-2-9PandaIT PHP

在上一遍中只是提到了可以使用增加一个ci_phpstrom.php文件的形式以支持codeigniter框架里面的一些方法和自定变量的的提示。如果我们在controller里面使用引入model层并不能实现 CTRL+左键 转到方法定义的功能。

这时候我们需要在CI_Controller头部或者是extends类里面增加以下注释说明也可以实现:

/** * @property m_userfound_lockedinfo $m_userfound_lockedinfo * @property m_withdrawal $m_withdrawal * @property m_withdrawal_faildata $m_withdrawal_faildata */class MY_Controller extends CI_Controller{     //...}

这时候我们在我们引入model的controller里面使用

class home extends my_api_controller{    function __construct()    {        parent::__construct();        $this->load->model('m_clientlog');    }        public function index_get()    {        $this->m_clientlog->updateClientLog();    }}

这时候我们就能发现m_clientlog里面的方法(function)会在phpStrom里面会有自动提示的功能,并且带有参数的说明,这对我们提高编程效率还是有很大帮助的。

同时我这边也写了一个输出注释声明的代码,每次增加 或者修改model文件的时候运行复制一下就能增加自动完成的提示了。

";}

标签:CI CodeIgniter phpStrom

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。