44

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?

1

2 Answers 2

90

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

Sign up to request clarification or add additional context in comments.

5 Comments

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; youtrack.jetbrains.com/issue/WI-760 :)
I couldn't find an issue for this specifically, so I created one; youtrack.jetbrains.com/issue/WI-16723
File | Settings | Editor | File Types in PHPStorm 9.
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)
PHPStorm 2017.1 on MAC: Preferences - Editor - File and Code Templates - Files
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

2 Comments

how to add .ctp into PHP'S registered patterns ? can you please help me?
Hi there, in tab Registered Patterns > Click + > add .cpt

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.