drupal_redirect_form

  1. drupal
    1. drupal6
    2. drupal7
Versionen
drupal6 – drupal7 drupal_redirect_form($form, $redirect = NULL)

Redirect the user to a URL after a form has been processed.

Übergabeparameter

$form An associative array containing the structure of the form.

$redirect An optional value containing the destination path to redirect to if none is specified by the form.

Verwandte Themen

▾ 3 functions call drupal_redirect_form()

drupal_process_form in includes/form.inc
This function is the heart of form API. The form gets built, validated and in appropriate cases, submitted.
openid_authentication in modules/openid/openid.module
Authenticate a user or attempt registration.
_batch_finished in includes/batch.inc
End the batch processing: Call the 'finished' callbacks to allow custom handling of results, and resolve page redirection.

Code

includes/form.inc, line 630

<?php
function drupal_redirect_form($form, $redirect = NULL) {
  $goto = NULL;
  if (isset($redirect)) {
    $goto = $redirect;
  }
  if ($goto !== FALSE && isset($form['#redirect'])) {
    $goto = $form['#redirect'];
  }
  if (!isset($goto) || ($goto !== FALSE)) {
    if (isset($goto)) {
      if (is_array($goto)) {
        call_user_func_array('drupal_goto', $goto);
      }
      else {
        drupal_goto($goto);
      }
    }
    drupal_goto($_GET['q']);
  }
}
?>

Kommentare

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen