[英]How do I can remove the label above input file form?
I've an application that was developed using Yii2, and this application I've use Kartik Input File for upload file. 我有一个使用Yii2开发的应用程序,并且此应用程序我使用Kartik输入文件上传文件。
From the example above, I want to remove / hide the "File" label. 从上面的示例中,我想删除/隐藏“文件”标签。
And I think, that label based on model
name. 而且我认为,该标签基于model
名称。
This is the code I use: 这是我使用的代码:
<?=
$form->field($model, 'file')->widget(FileInput::classname(), [
'options' => [
'accept' => 'doc/*', 'file/*',
'enableLabel' => false,
],
'pluginOptions' => [
'allowedFileExtensions' => ['csv', 'xls', 'xlsx'],
'showUpload' => FALSE,
'showPreview' => FALSE,
]
]);
?>
How do I can remove the label above? 如何删除上面的标签?
Thanks 谢谢
For removing the label you can simply use the following: 要删除标签,您只需使用以下命令:
<?=
$form->field($model, 'file')->widget(FileInput::classname(), [
'options' => [
'accept' => 'doc/*', 'file/*',
'enableLabel' => false,
],
'pluginOptions' => [
'allowedFileExtensions' => ['csv', 'xls', 'xlsx'],
'showUpload' => FALSE,
'showPreview' => FALSE,
]
])->label(false);
?>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.