在我的$number = [Int] 255
# Convert the number to a byte[4] array
$bytes = [System.BitConverter]::GetBytes($number)
# Write the bytes to a file
Add-Content -Path "D:\FILE.BIN" -Value $bytes -Encoding Byte
我有以下代码:
create.blade.php
在我的<div class="form-check">
<label for="active">active</label>
<input id="active" name = "active" type="checkbox" class="form-check-input" value="1">
</div>
以下内容中:
edit.blade.php
我的数据库结构的SQLFiddle包含数据。
我知道在没有选中时没有任何价值,打开复选框时不会有&#39;在&#39;因为值为1而不是&#39; on&#39;。
如何解决此问题?
答案 0 :(得分:1)
它实际上是一个HTML问题,您只是以错误的方式使用输入,您必须使用checked
而不是value
:
<input
id="active"
name="active"
type="checkbox"
class="form-check-input"
checked="{{ $company->active ? 'checked' : '' }}"
>