Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I recently discovered, that you can have phpdocs outside of classes and your IDE (like Eclipse) would autocomplete it.

For example:

<?php /* @var $this Controller */ ?> <div><?php echo $this->app()->name; ?></div>

Eclipse would autocomplete $this->

I found this code snippet in a framework, but I can't find any documentation about this type of phpdoc. Has anyone a link for me? I didn't know, this was possible?

Thanks in advance!

share|improve this question

1 Answer 1

In eclipce I know this way (Eclipse completions - @var (PHPDoc) question):

$that = $this;
if (false) $that = new Controller();

And use $that

But it should work in phpStorm IDE (with @var phpdoc)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.