在 Laravel Backpack/Setting 中使用单选框
Using radiobox in Laravel Backpack/Setting
嗨,我想在 Backpack for Laravel 中使用收音机。我有以下内容,但它没有显示任何单选框。我在这里做错了什么?
{"name":"value","label":"Value", "title":"Google Auth",
"type":"radio","options":{"0":"Off","1":"On"}}
试试这个:
$this->crud->addField([
'name' => 'value',
'label' => 'Value',
'type' => 'radio',
'options' => [ 0 => "Off",
1 => "On"
],
]);
之前 radio
字段类型中存在错误,但已在 Backpack\CRUD 3.1.50
中修复。 composer update
应该会为您解决:
嗨,我想在 Backpack for Laravel 中使用收音机。我有以下内容,但它没有显示任何单选框。我在这里做错了什么?
{"name":"value","label":"Value", "title":"Google Auth",
"type":"radio","options":{"0":"Off","1":"On"}}
试试这个:
$this->crud->addField([
'name' => 'value',
'label' => 'Value',
'type' => 'radio',
'options' => [ 0 => "Off",
1 => "On"
],
]);
之前 radio
字段类型中存在错误,但已在 Backpack\CRUD 3.1.50
中修复。 composer update
应该会为您解决: