You are here

public function TempStore::getSelectorValue in AJAX Comments 8

Get a single selector value, without the '#' prefix.

Parameters

\Symfony\Component\HttpFoundation\Request $request: The request object.

string $selector: The selector to retrieve.

Return value

string The value of the selector.

File

src/TempStore.php, line 69

Class

TempStore
A service to help store and retrieve data to be used across HTTP requests.

Namespace

Drupal\ajax_comments

Code

public function getSelectorValue(Request $request, $selector) {
  $selectors = $this
    ->getSelectors($request);
  $value = $selectors[$selector];
  return substr($value, strpos($value, '#') + 1);
}