Search code examples
cakephpphpstormcakephp-3.0

How to enable Auto Complete in PHPStorm for CakePHP templates


How to enable Auto Complete in PHPStorm for CakePHP templates.

For example $this and its functions, Helpers ... etc in the *.ctp files


Solution

  • Just add a type hint comment on top of your view code:

    <?php
    /* @var $this \App\View\AppView */
    

    For the records, in pre-namespaced CakePHP/2.x it used to be:

    <?php
    /* @var $this View */