-3

我已将我尝试过的 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');
4

1 回答 1

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语法将项添加到数组中。

于 2013-04-01T21:13:54.710 回答