簡體   English   中英

我正在使用INI文件格式創建Zend表單,但似乎無法從ini中填充options數組

[英]I am using an INI file format to create a Zend Form but I cannot seem to get the options array filled in from the ini

有沒有辦法將以下函數正確移植到Zend_Form_Element? 我有一個自定義元素,我正在傳遞自己的選項以了解我正在處理的細節:以下是PHP,以下將是INI

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

現在使用此函數可以很好地完成工作:-),但是將其轉換為ini是我迷失在翻譯中的地方:

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

現在,當我檢查對象時,好像所有選項都視為屬性!

任何有關此特定問題的幫助將不勝感激:-D

謝謝一大堆!

嘗試:

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

而這里是有關的問題http://framework.zend.com/issues/browse/ZF-2711

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM