Based on $form_id switch functions that are called
We are creating a module to attach to some simple contact forms. Based on
the $form_id we need to scrape different hidden fields from the form. I've
written a simple switch statement:
switch ($form_id) {
case 4:
$this->stc_lead_tracker_service_call($form, &$form_state);
break;
case 2309:
$this->stc_lead_tracker_service_call_trucking($form, &$form_state);
break;
case 22:
$this->stc_lead_tracker_service_call_contact($form, &$form_state);
break;
}
The function is simply written like:
function stc_lead_tracker_service_call($form, &$form_state) {
do some stuff
}
Two questions. 1) am I using the correct syntax to call a function in the
switch statement? 2) Do I include ($form, &$form_state) in both the switch
and the function itself?
No comments:
Post a Comment