airnet
airnet

Reputation: 2673

Meaning of # in variables

I was looking at some module code:

$element['location_settings'] = array( '#type' => 'value', '#value' => $element['#location_settings'], );

What is the meaning of # in #location_settings And i'm unsure whether $element['#location_settings'] is a form element or just a regular variable in this case.

Upvotes: 0

Views: 47

Answers (2)

windmaomao
windmaomao

Reputation: 7661

'#' is for Drupal theming, Drupal will read those variables for theming hook. These variable are not general, it means nothing if not passed into form function or theming function.

Upvotes: 0

tastysoop
tastysoop

Reputation: 180

In the Drupal FAPI all variables (keys), that starts with '#' treated as properties/data of the current node, all other variables treated as children nodes. This is just a FAPI convention.

So, $element['#location_settings'] can't be children form element, only regular variable.

Upvotes: 1

Related Questions