【发布时间】:2015-05-11 13:41:14
【问题描述】:
我正在尝试为 codeigniter 添加 phpstorm 自动完成功能,如在不同问题中所见。
提供的链接:https://github.com/topdown/phpStorm-CC-Helpers
我注释掉了指定的文件并添加了
* @property Test_model $test_model
致my_models.php
当我尝试从我的控制器加载Test_model.php 时:
$this->load->model('Test_model');
我明白了:
'找不到指定的类:Model.php'
如果我删除加载行并尝试:
$this->Test_model->insert_entry()
我明白了:
消息:未定义的属性:Test::$Test_model
Test.php:
class Test extends CI_Controller {
public function __construct(){
parent::__construct();
}
public function modelTutorial(){
$this->Test_model->insert_entry();
}
Test_model.php
class Test_model extends CI_Model{
public function __construct(){
parent::__construct();
}
public function insert_entry(){
die('asdasd');
}
}
【问题讨论】:
标签: php codeigniter model phpstorm