Module Building
There are a few basic things a developer needs to do in a custom module.... node creation is top of my list.This code is within a controller that is part of a custom module. I won't explain how to build the module but this code is within a file called ReportController.php.
The basic file code is:…
There are a few basic things a developer needs to do in a custom module.... SELECT, INSERT and DELETE queries are top of my list and this article demonstrates a few examples of SELECT and INSERT queries.This code is within a controller that is part of a custom module. I won't explain how to build…
For every settings page you'll need to use the Form API to allow the user to add/edit the configuration values. This is a simple example of the form and the submit function.
/**
* Form builder: Create and display the configuration settings form.
*/
function MY_MODULE_NAME_form($form, &$…
Adding a module configuration or settings page to the main Drupal menu is an important task and I like to add a page for each module I build...
Even if it's more of a 'help' page to explain what the module does or how to use it.
Adding one page is fairly simple....
/**
* Impliment hook_menu…
hook_permission() is a handy way to allow certain roles to access certain pages, i.e. the 'Administrator' to change settings and say 'Comms Team' to view the results. As per a lot of Drupal building the return value must be a nested array, and that can be tricky to remember... So here is an example…
Great explanation of how to get Dreamweaver to colour code other file types as PHP, i.e. .module or .install
The instructions are for a recent version (CS5 I think), but the technique is the same for older versions as I'm still using Dreamweaver 8...
http://fronterahouse.com/blog/news/color-code-…