2

CakePHP 3.0 introduces Rails-style erb tags in it's bake template files (.ctp).

The tags, <% and %>, and derivitives, expand to the php <? and ?> when the template is processed.
However, since PHPStorm doesn't recognize the tags (I've configured .ctp files as php as per Display CTP Files as PHP Files in PHPStorm) as legal php syntax, it decorates all files containing these tags with red squiggly underscore signifying syntax errors.

Anyone know how to include these tags as legal syntax so PHPStorm stops flagging them as errors?

Community
  • 1
  • 1
DJ Far
  • 497
  • 5
  • 12
  • AFAIK ( as per [WI-8638](https://youtrack.jetbrains.com/issue/WI-8638)) ASP-style tags are now disabled in PhpStorm. I may only suggest to download an older version of IDE (8.0.1 or older) and try there. Or wait few weeks (no official dates yet) and see if it will be working in v9 EAP build (v9 final is planned for Q2 2015). – LazyOne Feb 26 '15 at 20:51

1 Answers1

1

Easy AutoComplete in PHPStorm 8 and 9, for CakePHP 3.x in Views, Template, "*.ctp"

CakePHP 3.x Insert in file all, the next code, line 1 for CakePHP 3.x:

<?php /** @var \Cake\View\View $this */ ?>

CakePHP 2.x Insert in file all, the next code, line 1 for CakePHP 2.x:

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

;-)

Print Example in Action for CakePHP 3.x to PHPStorm 8: http://s25.postimg.org/ovkjbgtbj/Print_de_pantalla_579.jpg enter image description here

Sergio
  • 2,369
  • 1
  • 15
  • 22