Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 480
Patrick Bard Avatar asked Apr 17 '26 14:04

Patrick Bard


1 Answers

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

like image 84
Oliver Salzburg Avatar answered Apr 20 '26 16:04

Oliver Salzburg



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!