Moodle and NetBeans

I have been using NetBeans while for a while now as my IDE of choice, specifically when writing code for Moodle.

The one thing I don’t do, is spend a lot of time customising the IDE. The one thing I did pick up though was creating shortcuts – like the ones you would use in say Emmet.

For those not familiar with the process, this is what I did. Say for example you would like to add notifications to the screen. The Moodle code for that would look something like this:

\core\notification::add(‘Enrolled into courses and groups ‘, ‘success’);

This allows you to send a message to the user, and define the background. You read more about that here: moodleroot/lib/classes/notifications.php

To type out the notification each time is not really a problem, but you could create a shortcut in NetBeans for the task. To create the shortcut,

Click Tools -> Options from the main menu.


Once the options menu has loaded, click the Editor tab.


The Editor tab lists the current shortcuts available in NetBeans. Click the New button.


Enter a name of the shortcut. I create my using m_ and the name of the shortcut.


Add the code for the new shortcut and click Apply.


To use the shortcut in NetBeans, simply type the shortcut code and press the tab key.


The above is a quick example, but you can use it for creating methods as well, where it does become a time saver.

Leave a Reply

Your email address will not be published. Required fields are marked *