<?php
function data_menu(){
$items = array();
$items['learning/data'] = array(
'title' => 'Hello Data',
'page callback' => 'drupal_get_form',
'page arguments' => array('hello'),
'access callback' => TRUE,
);
return $items;
}
function hello($form, &$form_state){
$form = array();
$form['hello'] = array(
'#type' => 'fieldset',
'#title' => 'Please fill the form below',
);
$form['hello']['gender'] = array(
'#type' => 'radios',
'#title' => 'What is your gender?',
'#options' => drupal_map_assoc(array(t('Male'),
t('Female'))),
);
$form['hello']['fruit'] = array(
'#type' => 'checkboxes',
'#title' => 'Fruit You Like?',
'#options' => drupal_map_assoc( array(t('Watermellon'),
t('Apple'), t('Orange'), t('Papaya'))),
);
$form['hello']['submit'] = array(
'#type' => 'submit',
'#value' => 'Login',
);
return $form;
}
function data_menu(){
$items = array();
$items['learning/data'] = array(
'title' => 'Hello Data',
'page callback' => 'drupal_get_form',
'page arguments' => array('hello'),
'access callback' => TRUE,
);
return $items;
}
function hello($form, &$form_state){
$form = array();
$form['hello'] = array(
'#type' => 'fieldset',
'#title' => 'Please fill the form below',
);
$form['hello']['gender'] = array(
'#type' => 'radios',
'#title' => 'What is your gender?',
'#options' => drupal_map_assoc(array(t('Male'),
t('Female'))),
);
$form['hello']['fruit'] = array(
'#type' => 'checkboxes',
'#title' => 'Fruit You Like?',
'#options' => drupal_map_assoc( array(t('Watermellon'),
t('Apple'), t('Orange'), t('Papaya'))),
);
$form['hello']['submit'] = array(
'#type' => 'submit',
'#value' => 'Login',
);
return $form;
}
No comments:
Post a Comment