我在 Zend_Config_Xml 中有一个问题。我正在尝试扩展配置,但没有成功。现在,我有这个代码:
<?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>
问题是,如果我打印,可以说:
$schema = new Zend_Config_Xml(APPLICATION_PATH . '/configs/layout.schema.xml');
print_r($schema->sections->section->{"0"}->col);
它返回:
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] =>
)
所以它没有继承任何东西......我做错了什么?我已经尝试将“抽象”移动到每个列的相同级别,但它也没有工作......