You are here

public function Webform::componentByKey in Little helpers 7.2

Same name and namespace in other branches
  1. 7 src/Webform/Webform.php \Drupal\little_helpers\Webform\Webform::componentByKey()

Get the component array by it's form_key.

Parameters

string $form_key: form_key of the component.

Return value

array The component array (as in {webform_component}).

File

src/Webform/Webform.php, line 36

Class

Webform

Namespace

Drupal\little_helpers\Webform

Code

public function &componentByKey($form_key) {
  if (isset($this->webform['cids'][$form_key])) {
    return $this->webform['components'][$this->webform['cids'][$form_key]];
  }

  // Make return by reference work.
  $return = array();
  return $return;
}