Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions
Js Class Reference

Public Member Functions

 decodeGridSerializedInput ($encoded)
 

Detailed Description

@api

Since
100.0.2

Definition at line 18 of file Js.php.

Member Function Documentation

◆ decodeGridSerializedInput()

decodeGridSerializedInput (   $encoded)

Decode serialized grid data

Ignores non-numeric array keys

'1&2&3&4' will be decoded into: array(1, 2, 3, 4);

otherwise the following format is anticipated: 1=<encoded string>="">&2=<encoded string>="">: array ( 1 => array(...), 2 => array(...), )

Parameters
string$encoded
Returns
array

Definition at line 38 of file Js.php.

39  {
40  $isSimplified = false === strpos($encoded, '=');
41  $result = [];
42  parse_str($encoded, $decoded);
43  foreach ($decoded as $key => $value) {
44  if (is_numeric($key)) {
45  if ($isSimplified) {
46  $result[] = $key;
47  } else {
48  $result[$key] = null;
49  parse_str(base64_decode($value), $result[$key]);
50  }
51  }
52  }
53  return $result;
54  }
$value
Definition: gender.phtml:16

The documentation for this class was generated from the following file: