public static function Json::encode in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/lib/Drupal/Component/Serialization/Json.php \Drupal\Component\Serialization\Json::encode()
Uses HTML-safe strings, with several characters escaped.
Overrides SerializationInterface::encode
19 calls to Json::encode()
- ActiveLinkResponseFilter::setLinkActiveClass in core/
lib/ Drupal/ Core/ EventSubscriber/ ActiveLinkResponseFilter.php - Sets the "is-active" class on relevant links.
- ActiveLinkResponseFilterTest::providerTestSetLinkActiveClass in core/
tests/ Drupal/ Tests/ Core/ EventSubscriber/ ActiveLinkResponseFilterTest.php - Provides test data for testSetLinkActiveClass().
- 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.
- CKEditorAdminTest::testExistingFormat in core/
modules/ ckeditor/ src/ Tests/ CKEditorAdminTest.php - Tests configuring a text editor for an existing text format.
File
- core/
lib/ Drupal/ Component/ Serialization/ Json.php, line 22 - Contains \Drupal\Component\Serialization\Json.
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);
}