Hide label for input field

前端 未结 7 871
孤街浪徒
孤街浪徒 2021-02-06 23:04

I am trying to hide the label for a specific field in _form.php without success.

I have tried couple of variation like, but none is working:



        
7条回答
  •  滥情空心
    2021-02-06 23:43

    The best way to hide the label in form input field, is to pass empty value to array on 'attributeLabels()' function in the model.

    i.e you have input filed name 'client_name', so on the 'attributeLabels()' function's return array pass the empty string as array value

    public function attributeLabels()
    {
        return [
    
            'id' => 'ID',
            'gender' => 'Gender',
            'client_name' => '',
            .
            .
            .
              ]
     }
    

提交回复
热议问题