dmitri wrote: |
Quote: | For $this it is a lot harder, but the parser in the IDE knows which class does the function call normally right? |
No. It does not.
$this can be an instance of the method's class or any of the successors:
class AAA {
function BBB() {
return $this;
}
}
class CCC extends AAA {
}
$c = new CCC();
var_dump($c->BBB());
$a = new AAA();
var_dump($a->BBB()); |
|
Hi,
I have the same problem - how does PHPEd recognize $this via vardoc @var parameter?
Lots of frameworks will only include some view file, so "$this" construct is not defined within the view file.
However, the view file is always created by a controller.
So how can I tell inside view file, that "$this" should map to e.g. AdminController?
This is syntax used by Netbeans:
/* @var $this AdminController */
$this->getSomeProValue();
I tried
/**
* @var $this AdminController
*/
$this->getSomeProValue();
or
/**
* @var AdminController
*/
$this->getSomeProValue();
but neither of this works in NUSphere..
Can anybody give a clue on this?
Thanx in advance.
lubosdz