original_string: public function render()
      {
          $data        = $this->_config->toArray();
          $sectionName = $this->_config->getSectionName();
          $extends     = $this->_config->getExtends();
  
          if (is_string($sectionName)) {
              $data = array($sectionName => $data);
          }
  
          foreach ($extends as $section => $parentSection) {
              $data[$section][Zend_Config_Json::EXTENDS_NAME] = $parentSection;
          }
  
          // Ensure that each "extends" section actually exists
          foreach ($data as $section => $sectionData) {
              if (is_array($sectionData) && isset($sectionData[Zend_Config_Json::EXTENDS_NAME])) {
                  $sectionExtends = $sectionData[Zend_Config_Json::EXTENDS_NAME];
                  if (!isset($data[$sectionExtends])) {
                      // Remove "extends" declaration if section does not exist
                      unset($data[$section][Zend_Config_Json::EXTENDS_NAME]);
                  }
              }
          }
  
          $out = Zend_Json::encode($data);
          if ($this->prettyPrint()) {
               $out = Zend_Json::prettyPrint($out);
          }
          return $out;
      }
code: public function render()
      {
          $data        = $this->_config->toArray();
          $sectionName = $this->_config->getSectionName();
          $extends     = $this->_config->getExtends();
  
          if (is_string($sectionName)) {
              $data = array($sectionName => $data);
          }
  
          foreach ($extends as $section => $parentSection) {
              $data[$section][Zend_Config_Json::EXTENDS_NAME] = $parentSection;
          }
  
          // Ensure that each "extends" section actually exists
          foreach ($data as $section => $sectionData) {
              if (is_array($sectionData) && isset($sectionData[Zend_Config_Json::EXTENDS_NAME])) {
                  $sectionExtends = $sectionData[Zend_Config_Json::EXTENDS_NAME];
                  if (!isset($data[$sectionExtends])) {
                      // Remove "extends" declaration if section does not exist
                      unset($data[$section][Zend_Config_Json::EXTENDS_NAME]);
                  }
              }
          }
  
          $out = Zend_Json::encode($data);
          if ($this->prettyPrint()) {
               $out = Zend_Json::prettyPrint($out);
          }
          return $out;
      }
code_tokens: public function render ( ) { $ data = $ this -> _config -> toArray ( ) ; $ sectionName = $ this -> _config -> getSectionName ( ) ; $ extends = $ this -> _config -> getExtends ( ) ; if ( is_string ( $ sectionName ) ) { $ data = array ( $ sectionName => $ data ) ; } foreach ( $ extends as $ section => $ parentSection ) { $ data [ $ section ] [ Zend_Config_Json :: EXTENDS_NAME ] = $ parentSection ; } // Ensure that each "extends" section actually exists foreach ( $ data as $ section => $ sectionData ) { if ( is_array ( $ sectionData ) && isset ( $ sectionData [ Zend_Config_Json :: EXTENDS_NAME ] ) ) { $ sectionExtends = $ sectionData [ Zend_Config_Json :: EXTENDS_NAME ] ; if ( ! isset ( $ data [ $ sectionExtends ] ) ) { // Remove "extends" declaration if section does not exist unset ( $ data [ $ section ] [ Zend_Config_Json :: EXTENDS_NAME ] ) ; } } } $ out = Zend_Json :: encode ( $ data ) ; if ( $ this -> prettyPrint ( ) ) { $ out = Zend_Json :: prettyPrint ( $ out ) ; } return $ out ; }
docstring: Render a Zend_Config into a JSON config string.
  
  @since 1.10
  @return string
docstring_tokens: Render a Zend_Config into a JSON config string .