(How To) How to write the Drupal Module?

Tutorial : How to write the Drupal Module?

Let say the module name is xxx.

Telling Drupal about your module
Edit modules/xxx/xxx.info:


name = Module Name
description = A description of what your module does.
dependencies = module1 module2 module3
package = "Your arbitrary grouping string"
version = "5.1"

Telling Drupal who can use your module
Edit modules/xxx/xxx.module:


<?php
/**
* Valid permissions for this module
* @return array An array of valid permissions for the onthisdate module
*/
function xxx_perm() {
return array('access content');
} // function xxx_perm()
?>

Declare we have block content... [..]

| Read more..

Courtesy : Teramatics.com