You are here

private function YoastSeoFieldManager::formSet in Real-time SEO for Drupal 8

Our helper to insert values in a form from a given key.

Example : formSet($form, 'myform.#value', 'valueToInsert'); TODO : move this helper somewhere else.

Parameters

array $form: The form.

string $key: The key.

mixed $value: Value.

Return value

mixed Form with the set value.

2 calls to YoastSeoFieldManager::formSet()
YoastSeoFieldManager::addOverallScoreMarkup in src/YoastSeoFieldManager.php
Add Overall score markup to the form.
YoastSeoFieldManager::addSnippetEditorMarkup in src/YoastSeoFieldManager.php
Add code for snippet.

File

src/YoastSeoFieldManager.php, line 78

Class

YoastSeoFieldManager
Class YoastSeoFieldManager.

Namespace

Drupal\yoast_seo

Code

private function formSet(&$form, $key, $value) {
  return NestedArray::setValue($form, explode('.', $key), $value);
}