jsonDecode() публичный статический Метод

This method invokes json_decode to perform the decoding.
public static jsonDecode ( $value, $assoc = false, $depth = 512 ) : mixed
Результат mixed decoded variable
Пример #1
0
 /**
  * Sets Adapter to TActivePageAdapter and calls apter to process the
  * callback request.
  */
 protected function processCallbackRequest($writer)
 {
     $this->setAdapter(new TActivePageAdapter($this));
     $callbackEventParameter = $this->getRequest()->itemAt(TPage::FIELD_CALLBACK_PARAMETER);
     if (strlen($callbackEventParameter) > 0) {
         $this->_postData[TPage::FIELD_CALLBACK_PARAMETER] = TJavaScript::jsonDecode((string) $callbackEventParameter);
     }
     // Decode Callback postData from UTF-8 to current Charset
     if (($g = $this->getApplication()->getGlobalization(false)) !== null && strtoupper($enc = $g->getCharset()) != 'UTF-8') {
         foreach ($this->_postData as $k => $v) {
             $this->_postData[$k] = self::decodeUTF8($v, $enc);
         }
     }
     Prado::trace("Page onPreInit()", 'Prado\\Web\\UI\\TPage');
     $this->onPreInit(null);
     Prado::trace("Page initRecursive()", 'Prado\\Web\\UI\\TPage');
     $this->initRecursive();
     Prado::trace("Page onInitComplete()", 'Prado\\Web\\UI\\TPage');
     $this->onInitComplete(null);
     $this->_restPostData = new TMap();
     Prado::trace("Page loadPageState()", 'Prado\\Web\\UI\\TPage');
     $this->loadPageState();
     Prado::trace("Page processPostData()", 'Prado\\Web\\UI\\TPage');
     $this->processPostData($this->_postData, true);
     Prado::trace("Page onPreLoad()", 'Prado\\Web\\UI\\TPage');
     $this->onPreLoad(null);
     Prado::trace("Page loadRecursive()", 'Prado\\Web\\UI\\TPage');
     $this->loadRecursive();
     Prado::trace("Page processPostData()", 'Prado\\Web\\UI\\TPage');
     $this->processPostData($this->_restPostData, false);
     Prado::trace("Page raiseChangedEvents()", 'Prado\\Web\\UI\\TPage');
     $this->raiseChangedEvents();
     $this->getAdapter()->processCallbackEvent($writer);
     /*
     		Prado::trace("Page raisePostBackEvent()",'Prado\Web\UI\TPage');
     		$this->raisePostBackEvent();
     */
     Prado::trace("Page onLoadComplete()", 'Prado\\Web\\UI\\TPage');
     $this->onLoadComplete(null);
     Prado::trace("Page preRenderRecursive()", 'Prado\\Web\\UI\\TPage');
     $this->preRenderRecursive();
     Prado::trace("Page onPreRenderComplete()", 'Prado\\Web\\UI\\TPage');
     $this->onPreRenderComplete(null);
     Prado::trace("Page savePageState()", 'Prado\\Web\\UI\\TPage');
     $this->savePageState();
     Prado::trace("Page onSaveStateComplete()", 'Prado\\Web\\UI\\TPage');
     $this->onSaveStateComplete(null);
     /*
     		Prado::trace("Page renderControl()",'Prado\Web\UI\TPage');
     		$this->renderControl($writer);
     */
     $this->getAdapter()->renderCallbackResponse($writer);
     Prado::trace("Page unloadRecursive()", 'Prado\\Web\\UI\\TPage');
     $this->unloadRecursive();
 }