- Mymodule (folder)
- mymodule.info (must)
- mymodule.module (must)
- mymodule.inc
name = Honda HR-V //this is the name of the module description = HONDA HR-V car is the best i have ever seen in this world! //the description package = packageName //which package the module is in core = 7.x //the core number version = 7.8 //the version files[] = honda.module //files that'll include to dependencies[] = views //the modules which we must include
For step 2;
mymodule.module details are;
function honda_menu() { $items['honda/hrv'] = array( 'title' => 'Honda HR-V', 'page callback' => 'honda_page', 'access arguments' => array('access content'), 'file' => 'honda.inc', ); return $items; }
Please check "honda/hrv" out. This is the direction we go on the browser. If we click this, it's going to start on "honda.inc" page. Here is one of the most important things we have to know on drupal, is the way of how Drupal's work. "honda_page" is a function actually. When the module opened, this function'll be started.
For step 3;
function honda_page() { return t('This is the first module i created!'); }
As you see here, we've never used the ending tag ,"? >".
This honda_page function's been used before When we coding mymodule.module page, page callback.
By the way, you may ask me what the "t" is. t() is a function that used on drupal. This method handles the outputting works including the multilingual operations.
We'll see you next article!
If you want to see more information about t() function, you can visit official web site, here is api.drupal.org/t .
No comments:
Post a Comment
Thanks