You are here

public static function ArgumentPluginBase::encodeValidatorId in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/views/src/Plugin/views/argument/ArgumentPluginBase.php \Drupal\views\Plugin\views\argument\ArgumentPluginBase::encodeValidatorId()

Sanitize validator options including derivatives with : for js.

Reason and alternative: https://www.drupal.org/node/2035345.

Parameters

string $id: The identifier to be sanitized.

Return value

string The sanitized identifier.

See also

decodeValidatorId()

4 calls to ArgumentPluginBase::encodeValidatorId()
ArgumentPluginBase::buildOptionsForm in core/modules/views/src/Plugin/views/argument/ArgumentPluginBase.php
Provide a form to edit options for this plugin.
ArgumentValidateTest::testArgumentValidateUserUid in core/modules/user/tests/src/Kernel/Views/ArgumentValidateTest.php
Tests the User (ID) argument validator.
Entity::buildOptionsForm in core/modules/views/src/Plugin/views/argument_validator/Entity.php
Provides the default form for setting options.
User::buildOptionsForm in core/modules/user/src/Plugin/views/argument_validator/User.php
Provides the default form for setting options.

File

core/modules/views/src/Plugin/views/argument/ArgumentPluginBase.php, line 1226

Class

ArgumentPluginBase
Base class for argument (contextual filter) handler plugins.

Namespace

Drupal\views\Plugin\views\argument

Code

public static function encodeValidatorId($id) {
  return str_replace(':', '---', $id);
}