Re: [nyphp-talk] Overriding Array's

2007-05-03 Thread Rob Marscher
On May 3, 2007, at 10:57 PM, Joseph Crawford wrote: The main reason is that the default array is created by reading a YAML file. Cool... I figured something like that was going on. Doesn't totally mean you can read the YAML file into class properties... but whatever works. The Zend_Config c

Re: [nyphp-talk] Overriding Array's

2007-05-03 Thread Andy Dirnberger
Sorry about that email everyone. Sent via BlackBerry from Cingular Wireless -Original Message- From: "Joseph Crawford" <[EMAIL PROTECTED]> Date: Thu, 3 May 2007 22:57:12 To:"NYPHP Talk" Subject: Re: [nyphp-talk] Overriding Array's Rob, Thanks for y

Re: [nyphp-talk] Overriding Array's

2007-05-03 Thread Andy Dirnberger
Like really sad. Sent via BlackBerry from Cingular Wireless -Original Message- From: "Joseph Crawford" <[EMAIL PROTECTED]> Date: Thu, 3 May 2007 22:57:12 To:"NYPHP Talk" Subject: Re: [nyphp-talk] Overriding Array's Rob, Thanks for your code examp

Re: [nyphp-talk] Overriding Array's

2007-05-03 Thread Joseph Crawford
Rob, Thanks for your code example however having them as class properties will not work. The main reason is that the default array is created by reading a YAML file. The array is populated by reading a section of a flat file and then it reads a section specific to the current page (if any) and

Re: [nyphp-talk] Overriding Array's

2007-05-03 Thread Rob Marscher
On May 2, 2007, at 1:52 PM, Joseph Crawford wrote: We are looking to have the second array override the first array values. I cannot seem to get any of these methods to work. I assume you've fixed this by now... but here's a recursive method that I think does what you want: // overrides no

Re: [nyphp-talk] Overriding Array's

2007-05-02 Thread Jon Baer
Are you sure you need to even do the loop? Why not always array_unshift() the $links array ... array_unshift() prepends passed elements to the front of the array. Note that the list of elements is prepended as a whole, so that the prepended elements stay in the same order. All numerical arra

Re: [nyphp-talk] Overriding Array's

2007-05-02 Thread Joseph Crawford
ok let me try to clarify myself. I somehow need to loop over all elements and see if any of them contain numeric indexes like the stylesheets does. If it does we need to add the new element from the secondary array to the first. If it get's to the bottom element (without finding a numeric key f

Re: [nyphp-talk] Overriding Array's

2007-05-02 Thread Joseph Crawford
This will not work, hence if we have the following Array ( links => Array ( stylesheets => Array ( [0] => style.css, [1] => layout.css ) ) ) Array ( links => Array ( stylesheets => Array ( [0] => general.css ) ) ) we would want the end result to add the va

[nyphp-talk] Overriding Array's

2007-05-02 Thread Joseph Crawford
Guys I have 2 arrays the structures will be similar, for instance here is a chopped down version Array ( [http_metas] => Array ( [content-type] => text/html; charset=utf-8 [content-language] => en-us ) [metas] => Array ( [PreventParsing