2010年12月6日星期一

Re: [fw-mvc] [Zend_Config] Questions about heritage

Maybe you can load them separately, convert them to arrays using toArray(),
and then use array_merge(). I hope this helps!

--
*Hector Virgen*
Sr. Web Developer
http://www.virgentech.com

On Mon, Dec 6, 2010 at 7:52 AM, Apsy Kopate <apsy.kopate@gmail.com> wrote:

> Hi there :)
>
> I would like to know if there is a solution to "merge" parents branches
> with
> children ones.
>
> I explain by examples :
>
> My XML :
>
> <?xml version="1.0"?>
> <files xmlns:zf="http://framework.zend.com/xml/zend-config-xml/1.0/">
> <common>
> <files>
> <file><zf:const zf:name="ARBO_JS" />test1.js</file>
> </files>
> </common>
> <index zf:extends="common">
> <files>
> <file><zf:const zf:name="ARBO_JS" />test2.js</file>
> <file><zf:const zf:name="ARBO_JS" />test3.js</file>
> </files>
> </index>
> </files>
>
> Result expected :
> array(
> 'http://www.example.com/js/test1.js',
> 'http://www.example.com/js/test2.js',
> 'http://www.example.com/js/test3.js',
> );
>
> Result actual :
> array(
> 'http://www.example.com/js/test2.js',
> 'http://www.example.com/js/test3.js',
> );
>
> Zend_Config_Xml doesn't merge my parent nodes but overidde them.
>
> Is there a solution to have my result expected ? :)
>
> Thanks folks :)
>

没有评论: