我有3个版本的我试过的评论。他们都没有工作..我做错了什么..帮助将不胜感激。谢谢。
$patient_link = array(
'patient/demographics/armdme'=>"Patient",
'patient/comment/lookup'=>'Comments',
//if(login::$id='07L'){ echo 'komment'}=>'',
//if (in_array(login::$id, array('007', '0E1', '00D', '011', '02V', '139', '174', '07L', '0FK'))) { echo'komment'}=>'',
//if (in_array(login::$id, array('007', '0E1', '00D', '011', '02V', '139', '174', '07L', '0FK'))) { echo " . komment'=> . ";},
'patient/custom_forms_lookup'=>'Custom Forms',
'patient/eligibility/lookup'=>'Eligibility',
'patient/pmldme/lookup'=>'Encounter',
'patient/event_lookup'=>'Events',
'patient/history/lookup'=>'History',
'patient/image/lookup'=>'Images',
'patient/reorder/lookup'=>'Reorder');
答案 0 :(得分:1)
我猜这就是你的意思?我清理了格式并在完成后留下了一些碎片...... 007
,0E1
部分是什么?
<?php
$patient_link = array(
'patient/demographics/armdme' => 'Patient',
'patient/comment/lookup' => 'Comments',
'patient/custom_forms_lookup' => 'Custom Forms',
'patient/eligibility/lookup' => 'Eligibility',
'patient/pmldme/lookup' => 'Encounter',
'patient/event_lookup' => 'Events',
'patient/history/lookup' => 'History',
'patient/image/lookup' => 'Images',
'patient/reorder/lookup' => 'Reorder'
);
// What are these for??
// array('007', '0E1', '00D', '011', '02V', '139', '174', '07L', '0FK'),
要有条件地添加项目,请执行以下操作:
<?php
$patient_link = array(
'patient/demographics/armdme' => 'Patient'
);
if(in_array(login::$ida, array('007', '0E1', '00D', '011', '02V', '139', '174', '07L', '0FK'))) {
$patient_link['patient/comment/lookup'] = 'Comments';
}
$patient_link['patient/custom_forms_lookup'] = 'CustomForms';
$patient_link['patient/eligibility/lookup'] = 'Eligibility';
$patient_link['patient/pmldme/lookup'] = 'Encounter';
$patient_link['patient/event_lookup'] = 'Events';
$patient_link['patient/history/lookup'] = 'History';
$patient_link['patient/image/lookup'] = 'Images';
$patient_link['patient/reorder/lookup'] = 'Reorder';
使用$array[$key] = $value
语法在定义项目后将其添加到数组中。