Like many PHP developers who use Eclipse PDT, your first step after creating a new PHP file is probably to remove the closing ?> tag that Eclipse puts in it for you. Today I did those same three keystrokes (or more if you don't use keyboard shortcuts) to remove the damn closing PHP tag (whose absence is part of many coding standards), and decided to never do it again manually. The solution is quite simple:
- Open the eclipse preferences through the menu (exact location varies between operating systems).
- Select
PHP >> Templatesin the navigation on the left. - On the right, select the
New Simple PHP filetemplate and clickedit. - Change the pattern from
<?php
${cursor}
?>to
<?php
${cursor}Ok,Okagain, and you're done!
UPDATE: I submitted this as a bug report for Eclipse PDT, and it's now part of the latest release!



Post new comment