I cannot test in v17 because I am using v18. However, I just opened a large phtml template and did a test on that with $this showing correct code completion all the way to the bottom of the file.
Because phtml files are outside of a class context and PhpED cannot work out the class, I define $this before the first usage:
<?php
/**
* @var Mage_Catalog_Block_Product_List $this
*/
$_productCollection = $this->getLoadedProductCollection(); // code completion until end of file
?>
<?php
$_productCollection = $this->getLoadedProductCollection(); // this second PHP block also gets code completion
?> |
It is important you use the variable after defining it, possibly it needs to be in the same PHP block. If you do not, then PhpED does appear to 'forget' it.
This does NOT work for me and this appears to be effectively what the cakephp5 example does, using two separate code blocks:
<?php
/**
* @var Mage_Catalog_Block_Product_List $this
*/
?>
<?php
$_productCollection=$this->getLoadedProductCollection(); // does not get code completion
?> |