airnet
airnet

Reputation: 2673

why are there '#' in form attributes

When using forms. why put '#' for the keys? Any special reason?

$form['a'] = array(
        '#type' => 'textfield',
        '#title' => t('Score if not chosen'),
      );

Upvotes: 3

Views: 87

Answers (1)

Francis
Francis

Reputation: 21

In Drupal, it's a convention to add a hash tag (#) to the beginning of variable names that correspond to a setting, rather than an element. This is done to avoid namespace collisions.

Upvotes: 1

Related Questions