Link to home
Start Free TrialLog in
Avatar of f_o_o_k_y
f_o_o_k_yFlag for Poland

asked on

How to add additional file type to New context menu.

Hello.
I'm using Eclipse PDT for php development but it should be the same for Java.
When I'm using right click on file explorer I have New menu to add new file.
Depending on what type of project I;m working (java or php) there are different file types that I can create
for Java there is .java for php there is .php , .html and so on.
I want to add additional file extension .phtml (yes Phtml) .
I know I can add phtml file by using other and simple file then just typing filename.phtml but its more time consuming.

How can I do this?
Is there any configuration file?
Best Regards
FooKy
Avatar of CoyotesIT
CoyotesIT

Yes you can, here is a great tutorial on adding custom templates, which is what you will need to do.

In Ecplipse click \Window\Preferences and type templates in the search bar

You will then be able to add a new template by selecting the "Templates" under PHP for your new filetype.

http://eclipse.dzone.com/news/effective-eclipse-custom-templ

Good luck!

Avatar of f_o_o_k_y

ASKER

I don't think so. Or I couldn't understand this.

But using this I can create templates which I can then use by pressing ctl+space
for example to use if else statement.

But I want to be able to create new file in my "solution explorer" I see ther New php file with this code
<?php
${cursor}
?>

But when I added new Phtml and code ${cursor} then nothing happened and I still do not have phtml under right mouse buton in file explorer in eclipse.

I'm not sure but meybe I need to change something in php plugin for eclipse? or something else?
ASKER CERTIFIED SOLUTION
Avatar of CoyotesIT
CoyotesIT

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial