CakePHP template file usually have their default extension .ctp. And some modern browser can treat them as PHP file by default some are not. While I was working on NetBeans long time ago I faced some problem where I was supposed to do the design part. But without syntax highlighting it was taking too much of time to do the PHP code inside .ctp file. So at last I came up with a solution to introduce .ctp file in NetBeans as a PHP file.
To enable syntax highlight for .ctp files of CakePHP in NetBeans, follow these steps –
- Open NetBeans project
Open your CakePHP project
- Navigate to Files
Go to Tools -> Options -> Miscellaneous -> Files menu
- Add new file extension
Add ctp as new file extension and associate it with PHP
That’s it. Now restart NetBeans and open your CakePHP project again in NetBeans. Open CakePHP template files and you will see the syntax highlighted as PHP code.
Write your feedback in the comment box below if it works and helped you. Happy coding 🙂