Patrick Bard
Patrick Bard

Reputation: 1845

phpStorm showing php syntax in just some .ctp files

I am using phpStorm a while, and now I am experiencing something that doesn't make sense. I always used .ctp files as HTML and php syntax. And it work pretty fine.

But now, I've declared a function as "between", and phpStorm cannot help with any syntax in the between.ctp file.

I mean, if I rename the file to something like "_between", it works, and any other name the syntax works. Just this name doesn't, I do not have any idea of why.

Ok, probably a bug. But I need to figure it out why, and resolve it. I need this function name to be "between"

Thanks in advance.

Upvotes: 3

Views: 3053

Answers (1)

Oliver Salzburg
Oliver Salzburg

Reputation: 22099

This can happen if you accidentally create a file without a file extension.

When you open such a file, PhpStorm will ask you as what format to treat the the file. This will cause it to create a new pattern for the file type and then it will always detect the file as that type.

  1. Open the Settings and search for File Types to switch to the correct settings page.

  2. Check the file types for one that has the pattern "between" and remove it.

    enter image description here

Upvotes: 5

Related Questions