I successfully added a custom view helper with the following configuration:
https://gist.github.com/webdevilopers/b22f7471fd2b8d60cdea#file-module-php
The view helper has a custom variable named foo
:
https://gist.github.com/webdevilopers/b22f7471fd2b8d60cdea#file-abstractformautocomplete-php
As I mentioned this setup works fine as long as I have only a single element using the view helper.
As soon as I add more than one form element the setFoo
method gets only called once and the foo
variable remains set throughout the following elements.
https://gist.github.com/webdevilopers/b22f7471fd2b8d60cdea#file-autocompleteform-php
I read about Shared Services in ZF2 - is this such a case? How can I prevent this behaviour?