Codeigniter,form_dropdown禁用或显示标签[PHP]

时间:2018-09-22 20:19:09

标签: php codeigniter

您能帮我将以下回显结果放入标签中,而不是在下拉菜单中吗?或者,您能告诉我如何禁用下面的下拉菜单吗?

我的代码如下:

    <?php $owner_id = array();

    $owner_id['0'] = '-';
    foreach ($project->project_has_workers as $workers):
    $owner_id[$workers->user_id] = $workers->user->firstname.' '.$workers->user->lastname;
    endforeach;
    if(isset($project)){$user = $project->owner_id;}else{$user = $this->user->id;}

    echo form_dropdown('owner_id', $owner_id, $user,  
   'style="width:100%" class="label label-default"');

    ?>

任何帮助都非常感激:)

1 个答案:

答案 0 :(得分:0)

echo form_dropdown('owner_id', 
$owner_id, $user,  'style="width:100%" 
disabled="disabled" class="label label-default"');

解决方法之一:) 下拉菜单之外是否有可能显示回声?