theme_form_required_marker

  1. drupal
    1. 8
    2. 7
Versions
7 – 8 theme_form_required_marker($variables)

Returns HTML for a marker for required form elements.

Parameters

$variables An associative array containing:

  • element: An associative array containing the properties of the element.

Related topics

Code

includes/form.inc, line 3939

<?php
function theme_form_required_marker($variables) {
  // This is also used in the installer, pre-database setup.
  $t = get_t();
  $attributes = array(
    'class' => 'form-required', 
    'title' => $t('This field is required.'),
  );
  return '<span' . drupal_attributes($attributes) . '>*</span>';
}
?>