Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/292.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/70.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Cakephp选择框删除其中一个项目(如果是';是同一个名字吗_Php_Html_Cakephp_Drop Down Menu_Cakephp 2.0 - Fatal编程技术网

Cakephp选择框删除其中一个项目(如果是';是同一个名字吗

Cakephp选择框删除其中一个项目(如果是';是同一个名字吗,php,html,cakephp,drop-down-menu,cakephp-2.0,Php,Html,Cakephp,Drop Down Menu,Cakephp 2.0,我有这样一个问题: $customerList = $this->Project->Contact->find('list', array( 'fields' => array('Contact.id', 'Contact.displayName', 'Contact.companyName'), 'conditions' => array( 'Contact.group_id' => $this->Session-&g

我有这样一个问题:

$customerList = $this->Project->Contact->find('list', array(
   'fields' => array('Contact.id', 'Contact.displayName', 'Contact.companyName'),
    'conditions' => array(
          'Contact.group_id' => $this->Session->read('Auth.User.group_id'),
          'Contact.company_id !=' => 0,
          'Contact.deleted NOT' => 1
    ),
    'order' => 'Contact.companyName ASC'
));
如果我调试它,它将显示如下内容

array(
    'Bosiang Ramli' => array(
        (int) 90 => 'Bosiang Ramli'
    ),
    'Harts Ramli' => array(
        (int) 61 => 'Harts Ramli',
        (int) 67 => 'Kayoko Bishop',
        (int) 77 => 'Sintia Mary'
    ),
    'Microsoft' => array(
        (int) 83 => 'Internet Explorer',
        (int) 84 => 'Windows Eight',
        (int) 85 => 'X Box',
        (int) 86 => 'Windows Phone'
    ),
    'NySoft' => array(
        (int) 82 => 'Norman Leonardi'
    ),
    'Q Continuum' => array(
        (int) 81 => 'Andrew Stewart',
        (int) 87 => 'Jack Esters',
        (int) 88 => 'Ron Swanson',
        (int) 89 => 'Susan Mitchels'
    )
)
为什么我把它做成表格

echo $this->Form->input('contact_id',   
          array('label' => 'Customer', 'options' => $customerList)
);
它将取消博桑·拉姆利和哈茨·拉姆利的选择权? 我将展示这幅画。

这里有什么问题?如何修复它?

我只需要添加

'showParents' => true 
作为其中的一员