class FormHelper in Varbase: The Ultimate Drupal CMS Starter Kit (Bootstrap Ready) 8.4
Same name and namespace in other branches
- 8.8 src/Form/FormHelper.php \Drupal\varbase\Form\FormHelper
- 8.5 src/Form/FormHelper.php \Drupal\varbase\Form\FormHelper
- 8.6 src/Form/FormHelper.php \Drupal\varbase\Form\FormHelper
- 8.7 src/Form/FormHelper.php \Drupal\varbase\Form\FormHelper
- 9.0.x src/Form/FormHelper.php \Drupal\varbase\Form\FormHelper
Form helper.
Hierarchy
- class \Drupal\varbase\Form\FormHelper
Expanded class hierarchy of FormHelper
1 string reference to 'FormHelper'
1 service uses FormHelper
File
- src/
Form/ FormHelper.php, line 10
Namespace
Drupal\varbase\FormView source
class FormHelper {
/**
* The element info plugin manager.
*
* @var \Drupal\Core\Render\ElementInfoManagerInterface
*/
protected $elementInfo;
/**
* FormHelper constructor.
*
* @param \Drupal\Core\Render\ElementInfoManagerInterface $element_info
* Element info plugin manager.
*/
public function __construct(ElementInfoManagerInterface $element_info) {
$this->elementInfo = $element_info;
}
/**
* Applies standard process for elements in the form.
*
* @param array $element
* Form element.
*/
public function applyStandardProcessing(array &$element) {
if (empty($element['#process'])) {
$info = $this->elementInfo
->getInfo($element['#type']);
if (isset($info['#process'])) {
$element['#process'] = $info['#process'];
}
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
FormHelper:: |
protected | property | The element info plugin manager. | |
FormHelper:: |
public | function | Applies standard process for elements in the form. | |
FormHelper:: |
public | function | FormHelper constructor. |