“慢生活”不是懒惰,放慢速度不是拖延时间,而是让我们在生活中寻找到平衡。网站首页程序人生
webman-請求-獲取請求參數post
发布时间:2022-01-16 21:21:49作者:雪饮
![[!--pagekey--]](/e/data/images/notimg.gif)
和獲取請求參數get差不多的,有全獲取有單個值獲取,有單個值不存在時候的獲取,基本語法如$request->post('name');那麽這裏著重介紹的是獲取原始post請求,一般是raw數據:$post =
阅读全文>>webman-請求-獲取請求參數get
发布时间:2022-01-16 21:05:22作者:雪饮
![[!--pagekey--]](/e/data/images/notimg.gif)
實例:<?phpnamespace app\controller;use support\Request;class User{ public function hello(Request $request) { //获取整个get数组 如果请求没有get参数
阅读全文>>webman-快速開始-簡單示例-返回視圖
发布时间:2022-01-16 20:50:53作者:雪饮
![[!--pagekey--]](/e/data/images/notimg.gif)
返回視圖,一般同控制器路徑有對應關係,這裏以上次返回jsonp時候控制器爲例,則其對應hello方法實現如: $default_name = 'webman'; $name = $request->get('name', $
阅读全文>>webman-快速開始-簡單示例-返回json、xml及jsonp
发布时间:2022-01-16 19:37:20作者:雪饮
![[!--pagekey--]](/d/file/manshenghuo/chengxurensheng/2a626484ed009d46ec0e31eb926ced5e.png)
基於webman-快速開始-簡單示例-返回字符串的實例,如果我們要返回json就很簡單了程序修改為:<?phpnamespace app\controller;use support\Request;class User{ public funct
阅读全文>>webman-快速開始-簡單示例-返回字符串
发布时间:2022-01-16 18:59:00作者:雪饮
![[!--pagekey--]](/e/data/images/notimg.gif)
建立控制器User.php于app目錄下的controller目錄中:<?phpnamespace app\controller;use support\Request;class User{ public function hello(Request $request) {
阅读全文>>