1
yii2でファイル入力フォームにクラスを追加しようとしていますが、動作しないようです。Yii2 - フォームファイル入力にhtmlクラスを追加する
.cropit-image-input
をこのフォーム要素に追加しようとしています。
<?= $form->field($model, 'profile_picture_url')->fileInput() ?>
yii2でファイル入力フォームにクラスを追加しようとしていますが、動作しないようです。Yii2 - フォームファイル入力にhtmlクラスを追加する
.cropit-image-input
をこのフォーム要素に追加しようとしています。
<?= $form->field($model, 'profile_picture_url')->fileInput() ?>
次のような要素のクラスのプロパティを追加することができます。
<?= $form
->field($model, 'profile_picture_url')
->fileInput(['class'=>'cropit-image-input'])
?>
をあなたが任意の通常の入力のようなfileInput()
にクラスを追加することができます。例について
、
<?= $form->field($model, 'profile_picture_url')->fileInput(['class' => 'cropit-image-input form-control']) ?>