是否可以使用 Javascript 读取浏览器历史记录?如果答案是肯定的,我该怎么做?我想阅读它并将其保存在一个 JS 变量中。
如何在输入文本前后添加符号?就像图像附加一样。
我的代码:
<?= $form->field($model_product, 'percent')->textInput(['class'=>'smallInputFormInline'])->label('Percent',['class'=>'labelModalFormInline']) ?>
<?= $form->field($model_product, 'percent_all')->textInput(['class'=>'smallInputFormInline'])->label('Percent All',['class'=>'labelModalFormInline']) ?>
<?= $form->field($model_product, 'amount')->textInput(['class'=>'smallInputFormInline'])->label('Amount',['class'=>'labelModalFormInline']) ?>
Run Code Online (Sandbox Code Playgroud)
解决方案
我按照 ActiveForm 文档修改了我的代码并且它有效!
代码修改:
<?= $form->field($model_product, 'amount', ['template' => '{label}${input}'])->textInput(['class'=>'smallInputFormInline'])->label('Amount',['class'=>'labelModalFormInline']) ?>
Run Code Online (Sandbox Code Playgroud)