getExtends example



    /** * 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) {
                
/** * 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         foreach ($data as $section => $sectionData) {
            
/** * 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) {
                
class Zend_Config_Writer_Xml extends Zend_Config_Writer_FileAbstract
{
    /** * 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 {
                    
/** * 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         foreach ($data as $section => $sectionData) {
            
/** * Reads a section from the data store. * * @return Enlight_Config_Adapter_DbTable */
    public function read(Enlight_Config $config)
    {
        $name = $this->_namePrefix . $config->getName() . $this->_nameSuffix;

        $data = [];

        $extends = $config->getExtends();
        $currentSection = $config->getSection();
        while ($currentSection !== null) {
            $data += $this->readSection($name$currentSection);
            $currentSection = isset($extends[$currentSection]) ? $extends[$currentSection] : null;
        }

        $config->setData($data);

        return $this;
    }

    
Home | Imprint | This part of the site doesn't use cookies.