In PDT I can do
/* @var $this MyClass */
and eclipse will use that for autocompletition, suggestions and so forth… It’s useful in template files which get included into a function of a class from a templating engine.
Is there an equivalent for Aptana Studio 3?
I’ve also tried
/** @var $this MyClass */
and
/** @var MyClass $this */
EDIT
I’m evaluating the use of Aptana, it has some advantages over Eclipse + PDT. So, “use another IDE” isn’t really an answer.
$this does not get automatically resolved by the IDE to the correct class because it’s used outside of the class definition.
Example usage:
-
Template.class.php:
class Template { public function render() { include 'template.inc.php'; } private function foo() { echo 'bar!'; } } -
template.inc.php
<?php /*@var $this Template*/ ?> <html> <body> <?php /* I want that when I type "$this->" the IDE suggests me "foo()" */ $this->foo(); ?> </body> </html>
Upgrade to 3.0.7. It appears to be available in that version.
See http://jira.appcelerator.org/browse/APSTUD-1714