public function TempStore::setSelector in AJAX Comments 8
Set the selector for an ajax element for use across HTTP requests.
Parameters
string $selector: The selector to update.
string $value: The new value for the selector.
Throws
\Drupal\user\TempStoreException
1 call to TempStore::setSelector()
- TempStore::processForm in src/
TempStore.php - Update the temp store values while rebuilding a form, when necessary.
File
- src/
TempStore.php, line 121
Class
- TempStore
- A service to help store and retrieve data to be used across HTTP requests.
Namespace
Drupal\ajax_commentsCode
public function setSelector($selector, $value) {
$this->privateTempStore
->set($selector, '#' . $value);
}