Cakephp 在$form内查询->;input()数组

Cakephp 在$form内查询->;input()数组,cakephp,Cakephp,echo$form->input('field',数组( 'type'=>'radio','legend'=>$r['Attribute']['label'] 'separator' => '--separator--', 'options' => array() )); 如何查询内部选项以从数据库中检索此对应字段的选项。。 比如通过$r['attribute']['id']发送其属性\u id 并获取该属性的响应选

echo$form->input('field',数组( 'type'=>'radio','legend'=>$r['Attribute']['label']

            'separator' => '--separator--',
            'options' => array() 
        ));
如何查询内部选项以从数据库中检索此对应字段的选项。。 比如通过$r['attribute']['id']发送其属性\u id 并获取该属性的响应选项。。 我已经用Ajax post尝试过了 像

返回i.choice;})

它会返回i.choice中的选项。。 但我不知道如何将其放入选项数组中。。。
请建议我……

您不应该在视图中执行此操作。请在控制器中执行此操作,并将其传递到视图文件。

您好,我使用了ajax post并获取了相应属性id的选项,但不知道如何修复它选项复制:
                             var ht = $.ajax({
                                              type: "GET",
                                              url: "http://localhost/FormBuilder/index.php/forms/viewChoices/"+attribute_id,
                                                                 async: false
                                                    }).responseText;


               var myObject = eval('(' + ht + ')');


var data = myObject;var j=0;
 $.map(data.choices, function(i){ j++; alert(i.choice);