Yii请求组件
設置請求組件
$request = \Yii::$app->request;獲取參數
//通過get獲取參數 $id = $request->get("id"); //通過post獲取參數 $id = $request->post("id");設置默認值
//為get,post兩種方法設置默認參數10 $id = $request->get("id",10); $id = $request->post("id",10);判斷方式?
if($request->isGet){echo "this is Get"; }else if ($request->isPost){echo "this is Post"; }?
總結
- 上一篇: 福汇能交易美股吗
- 下一篇: Yii权限控制组件authManager