提交表单后,我正在尝试重定向页面。表格位于“formulaires/demande-de-subvention-pour-les-entraineurs”页面,我想重定向到“formulaires/demande-de-subvention-pour-les-entraineurs/entraineurs”我该怎么做?
function ulsform_form_alter(&$form, $form_state, $form_id) {
if ($form_id == 'ulsform_demande_de_subvention_pour_les_entraineurs_form') {
$form['#submit'][] = 'ulsform_demande_submited_form';
}else if($form_id == 'ulsform_demande_de_subvention_pour_les_entraineurs_02_form'){
$form['#submit'][] = 'ulsform_entraineur_submited_form';
}
}
function ulsform_demande_submited_form(&$form, $form_state){
global $user;
$v = $form_state['values'];
$form_state['redirect'] = 'formulaires/demande-de-subvention-pour-les-entraineurs/entraineurs';
/* My code to insert into the db */
}
它不起作用,当我尝试在另一个帖子上创建一个表单['#redirect'] 时,它也不起作用。我可以尝试什么?
感谢您的帮助!我是drupal的新手