views:

207

answers:

1

Is there a way I can get my the following function ported correctly to the the Zend_Form_Element? I have a custom element and i am passing my own options in for the details of what I am working on: below is the PHP and following will be the INI

$html = $this->helper->formBlah(array(
                'name'=>'foo',
                'value'=>'bar',
                'attribs'=>array('id'=>'boom','rows'=>10),
                'options'=>array(
                        'setup'=>array('mode'=>'exact')
                        )
        ));

now using this functions does the work perfect fine :-) but converting it to an ini is where I get lost in translations:

simple.elements.foo.type = "custom"
simple.elements.foo.options.label = "foo"
simple.elements.foo.id=boom
simple.elements.foo.options.attribs.rows = 10
simple.elements.foo.options.setup.mode = exact

now when I examine my object it looks as if it takes all options as attribs!

any assistance with this specific problem would be appreciated greatly :-D

Thanks a bunch!!

A: 

Try:

simple.elements.foo.type = "custom"
simple.elements.foo.options.label = "foo"
simple.elements.foo.id=boom
simple.elements.foo.options.attribs.rows = 10
simple.elements.foo.multiOptions.setup.mode = exact

And here for the related issue http://framework.zend.com/issues/browse/ZF-2711

Neel
Thanks for the reply but it seems as if that applies to multioptions but im not to sure thats the option i want to use these options arent for a select boc but for a custom js attributes. I was thinking options would be best because these extra fields are not for the textfield itself. Again i have used it perfectly fine when i creat using the php code to create the object i am just trying to convert to an ini configuration
AlbertRosa
It seems that it's a known issue because options is a reserved word.
Neel
Thanks Neel I will continue to research and see if I can find a solution. It's just a bit bothersome to work the element creation in two different ways. If there is a set in the form element there should be a just as equal action in the ini, or atleast a way to pre poluate the list. It could be just me misunderstanding how it should work.
AlbertRosa