I have cretad a menu for edit a form in drupal...
Code:
function pricepackages_menu()
{
$items = array();
$items['membership/packages'] = array(
'title' => t('Add Membership Packages'),
'page callback' => 'drupal_get_form',
'page arguments' => array('pricepackages_form'),
'access arguments' => array('access administration pages'),
);
$items['show/packages'] = array(
'title' => t('Manage Membership Packages'),
'page callback' => 'view_packages',
'access arguments' => array('access administration pages'),
);
$items['package/%/edit'] = array(
'title' => 'Edit Membership',
'page callback' => 'drupal_get_form',
'page arguments' => array('pricepackages_form_update'),
'access arguments' => array('access administration pages'),
);
return $items;
}
3rd menu is for eidt purpose...
The codd to show form i worte is:
function pricepackages_form_update($form, &$form_state)
{
$form['packagename'] = array(
'#type' => 'textfield',
'#title' => 'Package Name',
'#required' => TRUE,
);
}
Please let me know how can get the value of the id in the url :
URL : http://somedomain.com/package/1/edit
I want to get the id 1 from the url and than want to add a select query... please let me know how can i get that value so i can wrote teh select query...
Also do i have to specify a new parameter in the pricepackages_form_update() or not?
Thanks in advance...