43

I have a project running on CakePHP. All of my views are stored as ctp files. How do I render my ctp files so I have the same visual formatting that's present when I look at a file that is stored as a PHP file? In Notepad++, I was able to do this by selecting from the 'Language' toolbar option. Is there a similar feature in PHPStorm?

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
Lloyd Banks
  • 35,740
  • 58
  • 156
  • 248

2 Answers2

90

File | Settings | File Types, assign this extension to the PHP Files.

CrazyCoder
  • 389,263
  • 172
  • 990
  • 904
  • any idea if this .ctp could be added in the default configuration for PhpStorm 6? Seems to be an easy thing to implement and would at least partially complete this issue; http://youtrack.jetbrains.com/issue/WI-760 :) – thaJeztah Feb 15 '13 at 22:16
  • 1
    I couldn't find an issue for this specifically, so I created one; http://youtrack.jetbrains.com/issue/WI-16723 – thaJeztah Feb 15 '13 at 22:27
  • 9
    File | Settings | Editor | File Types in PHPStorm 9. – Vaughany Oct 12 '15 at 08:11
  • 4
    On Mac: PhpStorm > Preferences > Editor > File Types > PHP ... kinda dumb that you have to put an asterisk and period in front of every file extension in the list (like when would it ever NOT have those) – CommaToast Feb 27 '16 at 17:26
  • PHPStorm 2017.1 on MAC: Preferences - Editor - File and Code Templates - Files – guitarman Sep 12 '17 at 08:58
20

In PHP Storm 2017: File | Settings | Editor | File Types

Add .ctp into PHP's Registered Patterns tab

Select PHP & In tab Registered Patterns > Click + > add .cpt

enter image description here

Alex
  • 3,646
  • 1
  • 28
  • 25