public static function Json::decode in Drupal 8
Same name and namespace in other branches
- 9 core/lib/Drupal/Component/Serialization/Json.php \Drupal\Component\Serialization\Json::decode()
Decodes data from the serialization format.
Parameters
string $raw: The raw data string to decode.
Return value
mixed The decoded data.
Throws
\Drupal\Component\Serialization\Exception\InvalidDataTypeException
Overrides SerializationInterface::decode
99 calls to Json::decode()
- AssertContentTrait::setRawContent in core/
tests/ Drupal/ KernelTests/ AssertContentTrait.php - Sets the raw content (e.g. HTML).
- AttachedAssetsTest::testSettings in core/
tests/ Drupal/ KernelTests/ Core/ Asset/ AttachedAssetsTest.php - Tests JavaScript settings.
- BasicTest::testViewsWizardAndListing in core/
modules/ views/ tests/ src/ Functional/ Wizard/ BasicTest.php - BrowserTestBase::getDrupalSettings in core/
tests/ Drupal/ Tests/ BrowserTestBase.php - Gets the JavaScript drupalSettings variable for the currently-loaded page.
- BrowserTestBaseTest::testForm in core/
tests/ Drupal/ FunctionalTests/ BrowserTestBaseTest.php - Tests basic form functionality.
File
- core/
lib/ Drupal/ Component/ Serialization/ Json.php, line 25
Class
- Json
- Default serialization for JSON.
Namespace
Drupal\Component\SerializationCode
public static function decode($string) {
return json_decode($string, TRUE);
}