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
作为其中的一员