YII2的这个方法其实就是将请求的URL全部转成键值对的形式!接收处理;
$form->attributes = \Yii::$app->request->get();
例子如下:
Array
(
[goods] =>
[store] => app\models\Store Object
(
[_attributes:yii\db\BaseActiveRecord:private] => Array
(
[id] => 6
[admin_id] => 2
[is_delete] => 0
[is_recycle] => 0
[acid] => 0
[user_id] => 0
[wechat_platform_id] => 0
[wechat_app_id] => 6
[name] => 单店王(技术预览版)
[order_send_tpl] =>
[contact_tel] => 40002699991
[show_customer_service] => 1
[copyright] =>
[copyright_pic_url] =>
[copyright_url] =>
[delivery_time] => 10
[after_sale_time] => 5
[use_wechat_platform_pay] => 0
[web_key] => TFOBZ-NQ4CV-AF7PV-UUFBV-HT3H3-I6FD2
[kdniao_mch_id] => 1387271
[kdniao_api_key] => 49c1fbc2-2161-4eff-86d0-41b733689874
[ald_stat] =>
[cat_style] => 4
[home_page_module] => [{"name":"banner"},{"name":"ad-1"},{"name":"block-4-0"},{"name":"topic"},{"name":"single_cat-11"},{"name":"block-19-0"},{"name":"block-5-0"},{"name":"block-6-0"},{"name":"block-7-4"},{"name":"block-8-0"},{"name":"nav"},{"name":"miaosha"},{"name":"yuyue"},{"name":"block-10-0"},{"name":"block-12-0"},{"name":"single_cat-22"},{"name":"block-15-0"},{"name":"single_cat-20"},{"name":"block-16-0"},{"name":"block-17-1"},{"name":"block-18-1"},{"name":"block-8-0"},{"name":"pintuan"},{"name":"coupon"},{"name":"block-8-0"},{"name":"block-10-0"},{"name":"banner"},{"name":"ad-1"},{"name":"search"},{"name":"nav"},{"name":"cat"},{"name":"notice"},{"name":"topic"},{"name":"coupon"},{"name":"miaosha"},{"name":"cat"},{"name":"cat"},{"name":"nav"},{"name":"search"},{"name":"topic"},{"name":"block-27-0"}]
[address] =>
[cat_goods_cols] => 3
[over_day] => 3
[is_offline] => 0
[is_coupon] => 0
[cat_goods_count] => 6
[send_type] => 0
[member_content] =>
[nav_count] => 1
[integral] => 100
[integration] => 积分测试显示
[dial] => 1
[dial_pic] => https://st.lihuobao.cn/web/uploads/image/store_6/526f680909fa77c700a5d388a6f93119bc836b6f.png
[cut_thread] => 0
[purchase_frame] => 0
[is_recommend] => 1
[recommend_count] => 6
[status] => 0
[is_comment] => 1
[is_sales] => 1
[order_audit] => 1
[is_show_membercard] => 1
[membercard_bgcolor] => #ff050a
[is_integral] => 0
[is_live] => 1
[is_clerk] => 1
)
[_oldAttributes:yii\db\BaseActiveRecord:private] => Array
(
[id] => 6
[admin_id] => 2
[is_delete] => 0
[is_recycle] => 0
[acid] => 0
[user_id] => 0
[wechat_platform_id] => 0
[wechat_app_id] => 6
[name] => 单店王(技术预览版)
[order_send_tpl] =>
[contact_tel] => 40002699991
[show_customer_service] => 1
[copyright] =>
[copyright_pic_url] =>
[copyright_url] =>
[delivery_time] => 10
[after_sale_time] => 5
[use_wechat_platform_pay] => 0
[web_key] => TFOBZ-NQ4CV-AF7PV-UUFBV-HT3H3-I6FD2
[kdniao_mch_id] => 1387271
[kdniao_api_key] => 49c1fbc2-2161-4eff-86d0-41b733689874
[ald_stat] =>
[cat_style] => 4
[home_page_module] => [{"name":"banner"},{"name":"ad-1"},{"name":"block-4-0"},{"name":"topic"},{"name":"single_cat-11"},{"name":"block-19-0"},{"name":"block-5-0"},{"name":"block-6-0"},{"name":"block-7-4"},{"name":"block-8-0"},{"name":"nav"},{"name":"miaosha"},{"name":"yuyue"},{"name":"block-10-0"},{"name":"block-12-0"},{"name":"single_cat-22"},{"name":"block-15-0"},{"name":"single_cat-20"},{"name":"block-16-0"},{"name":"block-17-1"},{"name":"block-18-1"},{"name":"block-8-0"},{"name":"pintuan"},{"name":"coupon"},{"name":"block-8-0"},{"name":"block-10-0"},{"name":"banner"},{"name":"ad-1"},{"name":"search"},{"name":"nav"},{"name":"cat"},{"name":"notice"},{"name":"topic"},{"name":"coupon"},{"name":"miaosha"},{"name":"cat"},{"name":"cat"},{"name":"nav"},{"name":"search"},{"name":"topic"},{"name":"block-27-0"}]
[address] =>
[cat_goods_cols] => 3
[over_day] => 3
[is_offline] => 0
[is_coupon] => 0
[cat_goods_count] => 6
[send_type] => 0
[member_content] =>
[nav_count] => 1
[integral] => 100
[integration] => 积分测试显示
[dial] => 1
[dial_pic] => https://st.lihuobao.cn/web/uploads/image/store_6/526f680909fa77c700a5d388a6f93119bc836b6f.png
[cut_thread] => 0
[purchase_frame] => 0
[is_recommend] => 1
[recommend_count] => 6
[status] => 0
[is_comment] => 1
[is_sales] => 1
[order_audit] => 1
[is_show_membercard] => 1
[membercard_bgcolor] => #ff050a
[is_integral] => 0
[is_live] => 1
[is_clerk] => 1
)
[_related:yii\db\BaseActiveRecord:private] => Array
(
)
[_errors:yii\base\Model:private] =>
[_validators:yii\base\Model:private] =>
[_scenario:yii\base\Model:private] => default
[_events:yii\base\Component:private] => Array
(
)
[_behaviors:yii\base\Component:private] => Array
(
)
)
[keyword] =>
[status] =>
[plugin] => 0
[limit] => 10
[page] => 1
[drug_type] =>
[fields] =>
[flag] =>
[goods_no] =>
[platform_type] =>
)