Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse PHP IDE - custom auto complete tags

New to Eclipse IDE and was wondering is there is a way of adding an auto complete/change so that if I type:

mres

it will translate it to

mysql_real_escape_string()

I know of the normal PHP code completion, but couldn't see anything about making custom shortcuts.

Thanks, Niggles

like image 810
niggles Avatar asked May 11 '26 10:05

niggles


1 Answers

If you using PDT, create your own PHP Template. From the menu Window > Preferences, choose PHP > Editor > Templates. Click New button, then use mres as the template name, then put

mysql_real_escape_string(${cursor})

as a pattern.

To use it, just type mres and press Ctrl+Space. If there are no other alternative for the mres, then your template will be used right away. If you happened to have 2 or more templates that started with mres or contain mres in the template name, a popup will be showed so you can choose which you want to use.

like image 69
Donny Kurnia Avatar answered May 12 '26 23:05

Donny Kurnia



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!