100字范文,内容丰富有趣,生活中的好帮手!
100字范文 > php+go+to 让phpstrom支持codeigniter框架实现 (GO TO )转到定义的功能

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

时间:2022-12-07 05:34:14

相关推荐

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

-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文件的时候运行复制一下就能增加自动完成的提示了。

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。