CakePHP in NetBeans - ctp file extension

CakePHP (.CTP) Syntax Highlighting in NeatBeans

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 –

  1. Open NetBeans project

    Open your CakePHP project

  2. Navigate to Files

    Go to Tools -> Options -> Miscellaneous -> Files menu

  3. 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 🙂

Shaharia is a professional software engineer with more than 10 years of experience in the relevant fields. Digital ad certified, cloud platform architect, Big data enthusiasts, tech early adopters.