Changeset View
Changeset View
Standalone View
Standalone View
src/aphront/httpparametertype/AphrontJSONHTTPParameterType.php
- This file was added.
<?php | |||||
final class AphrontJSONHTTPParameterType | |||||
extends AphrontHTTPParameterType { | |||||
protected function getParameterDefault() { | |||||
return array(); | |||||
} | |||||
protected function getParameterValue(AphrontRequest $request, $key) { | |||||
$str = $request->getStr($key); | |||||
return phutil_json_decode($str); | |||||
} | |||||
protected function getParameterTypeName() { | |||||
return 'string (json object)'; | |||||
} | |||||
protected function getParameterFormatDescriptions() { | |||||
return array( | |||||
pht('A JSON-encoded object.'), | |||||
); | |||||
} | |||||
protected function getParameterExamples() { | |||||
return array( | |||||
'v={...}', | |||||
); | |||||
} | |||||
} |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0