Config XML in Zend doesn't extends correctly

364 Views Asked by At

I have a problem within Zend_Config_Xml. I'm trying to extend the configuration but it didn't work. Right now, I have this code:

<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns:zf="http://framework.zend.com/xml/zend-config-xml/1.0/">

    <sections>

        <section name="Definición general">
            <configuration>
                <cols value="3" />
                <width value="960" />
            </configuration>

            <abstract>
                <height value="0" />
                <margin>
                    <top value="15" />
                    <right value="0" />
                    <bottom value="0" />
                    <left value="15" />
                </margin>
            </abstract>

            <cols>
                <big name="Columna Ancha - 100% del ancho" extends="abstract">
                    <cols value="3" />
                    <width value="960" />
                </big>
                <slider name="Columna para sliders" zf:extends="abstract">
                    <cols value="2" />
                    <width value="615" />
                </slider>
                <rightSmall name="Columan derecha chica" zf:extends="sections.section.abstract">
                    <cols value="1" />
                    <width value="300" />
                </rightSmall>
                <leftSmall name="Columan izquierda chica" zf:extends="abstract">
                    <cols value="1" />
                    <widht value="300" />
                </leftSmall>
                <centerSmall name="Columna central chica" zf:extends="abstract">
                    <cols value="1" />
                    <width value="300" />
                </centerSmall>
            </cols>
        </section>

        <section name="Sección con medidas especiales" id="video_reverted">
            <configuration>
                <cols value="4" />
                <width value="960" />
            </configuration>
            <cols>
                <video name="Video Principal">
                    <cols value="4" />
                    <width value="960" />
                    <height value="0" />
                    <margin>
                        <top value="15" />
                        <right value="0" />
                        <bottom value="0" />
                        <left value="15" />
                    </margin>
                </video>
            </cols>
        </section>
    </sections>
</schema>

The problem is that if I print, lets say:

$schema = new Zend_Config_Xml(APPLICATION_PATH . '/configs/layout.schema.xml');
print_r($schema->sections->section->{"0"}->col);

It returns:

Zend_Config Object
(
    [_allowModifications:protected] => 
    [_index:protected] => 0
    [_count:protected] => 3
    [_data:protected] => Array
        (
            [name] => Columna para sliders
            [cols] => 2
            [width] => 615
        )

    [_skipNextIteration:protected] => 
    [_loadedSection:protected] => 
    [_extends:protected] => Array
        (
        )

    [_loadFileErrorStr:protected] => 
)

So it is not inheriting anything... What am I doing wrong? I already tried moving "abstract" to the same level of every col, but it didn't work either....

0

There are 0 best solutions below