getSectionName example



    /** * Render a Zend_Config into a JSON config string. * * @since 1.10 * @return 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

    /** * Render a Zend_Config into a XML config string. * * @since 1.10 * @return string */
    public function render()
    {
        $xml         = new SimpleXMLElement('<zend-config xmlns:zf="' . Zend_Config_Xml::XML_NAMESPACE . '"/>');
        $extends     = $this->_config->getExtends();
        $sectionName = $this->_config->getSectionName();

        if (is_string($sectionName)) {
            $child = $xml->addChild($sectionName);

            $this->_addBranch($this->_config, $child$xml);
        } else {
            foreach ($this->_config as $sectionName => $data) {
                if (!($data instanceof Zend_Config)) {
                    $xml->addChild($sectionName(string) $data);
                } else {
                    $child = $xml->addChild($sectionName);

                    
class Zend_Config_Writer_Array extends Zend_Config_Writer_FileAbstract
{
    /** * Render a Zend_Config into a PHP Array config string. * * @since 1.10 * @return string */
    public function render()
    {
        $data        = $this->_config->toArray();
        $sectionName = $this->_config->getSectionName();

        if (is_string($sectionName)) {
            $data = array($sectionName => $data);
        }

        $arrayString = "<?php\n"
                     . "return " . var_export($data, true) . ";\n";

        return $arrayString;
    }
}


    /** * Render a Zend_Config into a YAML config string. * * @since 1.10 * @return 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_Yaml::EXTENDS_NAME] = $parentSection;
        }

        // Ensure that each "extends" section actually exists
/** * Render a Enlight_Config_BaseConfig into a INI config string. * * @since 1.10 * * @return string */
    public function render()
    {
        $iniString = '';
        $extends = $this->_config->getExtends();
        $sectionName = $this->_config->getSectionName();

        if ($this->_renderWithoutSections == true) {
            $iniString .= $this->_addBranch($this->_config);
        } elseif (\is_string($sectionName)) {
            $iniString .= '[' . $sectionName . "]\n"
                       . $this->_addBranch($this->_config)
                       . "\n";
        } else {
            $config = $this->_sortRootElements($this->_config);
            foreach ($config as $sectionName => $data) {
                if (!($data instanceof Enlight_Config_BaseConfig)) {
                    
/** * Render a Zend_Config into a INI config string. * * @since 1.10 * @return string */
    public function render()
    {
        $iniString   = '';
        $extends     = $this->_config->getExtends();
        $sectionName = $this->_config->getSectionName();

        if($this->_renderWithoutSections == true) {
            $iniString .= $this->_addBranch($this->_config);
        } else if (is_string($sectionName)) {
            $iniString .= '[' . $sectionName . ']' . "\n"
                       .  $this->_addBranch($this->_config)
                       .  "\n";
        } else {
            $config = $this->_sortRootElements($this->_config);
            foreach ($config as $sectionName => $data) {
                if (!($data instanceof Zend_Config)) {
                    
Home | Imprint | This part of the site doesn't use cookies.