您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

laravel怎么接收和保存一组checkbox到数据库?

2024/4/12 8:01:17发布22次查看
正在使用的是laravel 5.2,我知道怎么接收text,email, select, radio, textarea等,并把它们保存到数据库,但是不知道怎么接收和保存一组checkbox到数据库。
比如下面这个例子:
{!! form::open(array('url' => 'foo/bar')) !!} email address we'll never share your email with anyone else. password example select 12345example multiple select 12345example textarea file input this is some placeholder block-level help text for the above input. it's a bit lighter and easily wraps to a new line. option one is this and that—be sure to include why it's great
option two can be something else and selecting it will deselect option one
option three is disabled
1 2 3
submit {!! form::close() !!}

回复内容: 正在使用的是laravel 5.2,我知道怎么接收text,email, select, radio, textarea等,并把它们保存到数据库,但是不知道怎么接收和保存一组checkbox到数据库。
比如下面这个例子:
{!! form::open(array('url' => 'foo/bar')) !!} email address we'll never share your email with anyone else. password example select 12345example multiple select 12345example textarea file input this is some placeholder block-level help text for the above input. it's a bit lighter and easily wraps to a new line. option one is this and that—be sure to include why it's great
option two can be something else and selecting it will deselect option one
option three is disabled
1 2 3
submit {!! form::close() !!}

使用name=check[ ]
这样接收的就是一个数组
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product