function Json::encode
Uses HTML-safe strings, with several characters escaped.
Overrides SerializationInterface::encode
29 calls to Json::encode()
- ActiveLinkResponseFilter::setLinkActiveClass in core/
lib/ Drupal/ Core/ EventSubscriber/ ActiveLinkResponseFilter.php - Sets the "is-active" class and aria-current attribute on relevant links.
- BlockLibraryController::listBlocks in core/
modules/ block/ src/ Controller/ BlockLibraryController.php - Shows a list of blocks that can be added to a theme's layout.
- BlockListBuilder::buildBlocksForm in core/
modules/ block/ src/ BlockListBuilder.php - Builds the main "Blocks" portion of the form.
- CKEditor5::buildConfigurationForm in core/
modules/ ckeditor5/ src/ Plugin/ Editor/ CKEditor5.php - Form constructor.
- ConfigTranslationController::itemPage in core/
modules/ config_translation/ src/ Controller/ ConfigTranslationController.php - Language translations overview page for a configuration name.
File
-
core/
lib/ Drupal/ Component/ Serialization/ Json.php, line 17
Class
- Json
- Default serialization for JSON.
Namespace
Drupal\Component\SerializationCode
public static function encode($variable) {
// Encode <, >, ', &, and ".
return json_encode($variable, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT);
}