[fw-general] How to get a resource from a controller plugin?

2010-05-13 Thread Sergio Rinaudo
Hi, I need to get a db resource from a controller plugin that extends Zend_Controller_Plugin_Abstract. In a controller context I'll do $bootstrap = $this-getInvokeArg('bootstrap'); $resource = $bootstrap-getResource('myresource'); but what if I want to get the resource in

Re: [fw-general] How to get a resource from a controller plugin?

2010-05-13 Thread Aleksey Zapparov
Hello, You can either register precious resources in registry, e.g.: protected function _initMyResource() { $res = 'foobar'; Zend_Registry::set('myResource', $res); return $res; } Or you can register whole bootstrap, so you can place in it's constructor, something like this: public

RE: [fw-general] How to get a resource from a controller plugin?

2010-05-13 Thread Sergio Rinaudo
Nice solution, thanks! Sergio _ Importa i tuoi amici di Facebook su Messenger http://www.windowslive.it/importaAmici.aspx

[fw-general] create tree from arrays

2010-05-13 Thread shahrzad khorrami
hi all, I want to create an array from another array to create json file in my format and pass it to a js libraryok. I just know that I have to use recursive function... but how? it's hard for me to create the new array.. main array: Array ( [0] = Array ( [nid] = 1

[fw-general] create tree from arrays

2010-05-13 Thread Daniel Latter
Hi, Have a look at: http://www.box.net/shared/fdyp2h2yrp It includes a recursive function you could use to build your tree. Thanks Dan On 13 May 2010 10:51, shahrzad khorrami shahrzad.khorr...@gmail.com wrote: hi all, I want to create an array from another array to create json file in my

Re: [fw-general] create tree from arrays

2010-05-13 Thread Ralph Schindler
There are a couple of ways to go about buiding and recursing trees in PHP. Utilizing functions to do it is one route. The more object-oriented route would be to build a tree structure around SPL's RecursiveIterator, and RecursiveIteratorIterator. A component in Zend Framework that does this

Re: [fw-general] create tree from arrays

2010-05-13 Thread Daniel Latter
To clarify more on the link I posted, in contains a view helper that takes a flat array (with 'parentID' element), and outputs a tree. When I said function I meant on object method. Thanks On 13 May 2010 14:56, Ralph Schindler ralph.schind...@zend.com wrote: There are a couple of ways to go

[fw-general] Re: validator chains and context

2010-05-13 Thread David Muir
Awesome :-) Is the code public domain/new-bsd? Cheers, David -- View this message in context: http://zend-framework-community.634137.n4.nabble.com/validator-chains-and-context-tp2130875p2197075.html Sent from the Zend Framework mailing list archive at Nabble.com.

[fw-general] Response time related to time between requests

2010-05-13 Thread Jurian Sluiman
Hi all, I have a very strange problem. Most times a first request takes a very long time to complete. Profiling show the costs of the first request is 4,935,395 while other requests (same page, just some clicks later) cost only about 501,303. There's also a difference between response time: about

[fw-general] Re: Response time related to time between requests

2010-05-13 Thread dennis.winter
Hi, I think this is because of Opcode caching of APC or Zend Optimizer or any other Bytecode cache! It seems, that Apache or anything related to it, is kind of sleeping, and it needs some time to woke up. On my systems it's the same, and there it is a problem of zend optimizer. I can't give you

[fw-general] zend_mail and microsoft exchange

2010-05-13 Thread darthtina
Hello All, Thanks for helping! I had my unix server setup to use a pop account for sending mail and have now changed it to an exchange account to send my mail through. I am just using smtp zend_mail to send the basic text emails. When I switch to the exchange account I get this error:

Re: [fw-general] zend_mail and microsoft exchange

2010-05-13 Thread Daniel Latter
Are you sending the emails from a script on a windows box? If so, try just using the email address in the to/form sections, instead of the form: Something some...@example.org Thanks On 13 May 2010 17:18, darthtina ca_arsena...@yahoo.com wrote: Hello All, Thanks for helping! I had my

Re: [fw-general] zend_mail and microsoft exchange

2010-05-13 Thread Mark Steudel
Are you trying to relay an email through your exchange server to an outside email address?What happens if you use an email address that is part of the exchange server? On Thu, May 13, 2010 at 9:18 AM, darthtina ca_arsena...@yahoo.com wrote: Hello All, Thanks for helping!  I had my unix

[fw-general] Re: zend_mail and microsoft exchange

2010-05-13 Thread darthtina
Yes, I'm using it as a relay on a Unix box for my software. If I send it to an address on that exchange server I get the same error... :( -- View this message in context: http://zend-framework-community.634137.n4.nabble.com/zend-mail-and-microsoft-exchange-tp219p2197906.html Sent from the

Re: [fw-general] create tree from arrays

2010-05-13 Thread Aleksey Zapparov
Hello, Here's primitive variant of function you might looking for. It's very simplific and non-flexible, but it gives an idea: /** * @param array $arr Array to process * @param integer $id (optional) Base parent ID * @return array */ function mktree_array($arr, $id = 0) { $result =

Re: [fw-general] Re: zend_mail and microsoft exchange

2010-05-13 Thread Mark Steudel
Is the from address a valid exchange server account? I have found that I always need a exchange admin to help out when it comes to getting permissions to send through the server. MS On Thu, May 13, 2010 at 10:28 AM, darthtina ca_arsena...@yahoo.com wrote: Yes, I'm using it as a relay on a Unix

[fw-general] Re: zend_mail and microsoft exchange

2010-05-13 Thread darthtina
Ok, still stuck on this. Here is the stack trace if that helps: 2010-05-13T12:50:50-07:00 DEBUG (7): 501 5.1.3 Invalid address #0 /var/test/trunc/library/Zend/Mail/Protocol/Smtp.php(289): Zend_Mail_Protocol_Abstract-_expect(Array, 300) #1

[fw-general] Re: zend_mail and microsoft exchange

2010-05-13 Thread darthtina
Yep, it's valid and I even have my outlook setup and can test it the exchange server is at godaddy and they seem to only know how to setup outlook clients Thanks for your input! -- View this message in context:

Re: [fw-general] Re: zend_mail and microsoft exchange

2010-05-13 Thread Mark Steudel
Have you tried telneting into the exchange and sending to and from the user's your sending as? That might give you some insight that you might not get from the php level. MS On Thu, May 13, 2010 at 1:02 PM, darthtina ca_arsena...@yahoo.com wrote: Ok, still stuck on this.  Here is the stack

[fw-general] grouped Zend_Form text elements

2010-05-13 Thread Philip Iezzi
Hi, What I'm trying to accomplish is to group two Zend_Form_Element_Text elements that they show up on the same line. I'm styling my standard Zend_Form output (standard decorators) by CSS to bring the form element's label to the left side of the input field. $zipcode = new

[fw-general] validating forms with mootools / json

2010-05-13 Thread Meroe Meroe
Does anyone have any links or insight how I could use ZF default validation with an ajax submitted form? There was a jquery video on the topic but am looking for something mootools related. Thanks in advance.

[fw-general] Re: zend_mail and microsoft exchange

2010-05-13 Thread darthtina
Good idea, thanks! I get an error though, 530 5.7.1 Client was not authenticated and then it closes out. I guess the exchange server isn't setup to take annoymous requests like that back to the drawing board.. -- View this message in context: