使用PHPDoc@property加载自动完成模型
我正在使用PHP的Codeigniter框架。我想知道是否有一种方法可以使用PHPDoc@property在模型中加载自动完成的方法 我的意思是使用PHPDoc@property加载自动完成模型,php,eclipse,codeigniter,netbeans,phpdoc,Php,Eclipse,Codeigniter,Netbeans,Phpdoc,我正在使用PHP的Codeigniter框架。我想知道是否有一种方法可以使用PHPDoc@property在模型中加载自动完成的方法 我的意思是 class abc_controller extends Controller { /** * @property Model1 */ function func() { $this->load->model("Model1"); // I am loading the model here $r
class abc_controller extends Controller {
/**
* @property Model1
*/
function func() {
$this->load->model("Model1"); // I am loading the model here
$result = $this->Model1->getIds();
// When I type Model1 in the statement above, it should popup
// an autocompletion box populated with all the methods of Model1
}
}
我在使用Cakephp时使用NetBeans做了类似的事情。我想知道CodeIgniter是否也能做到这一点/
关于您需要向类phpdoc添加属性。看看这个视频
<?php
/**
* blah blah balh
*
* @property Model1 Model1
* @property <type> <name>
*/
class abc_controller extends Controller {
/**
* blah blah blah
*/
function func() {
$this->load->model("Model1"); // I am loading the model here
$result = $this->Model1->getIds();
// When I type Model1 in the statement above, it should popup
// an autocompletion box populated with all the methods of Model1
}
}
?>
function func(){
$myObj = $this->getMixedType();
/* @var $myObj TypeOfMyObject */
// The vdoc has to be below the function call, otherwise the latest return type will be used
// Shortcut for generating vdoc is "vdoc" + tab
// For example if you have vdoc above the function call and function
// returns Type1, then your object will have autocomplete for Type1.
}