Index.php 442 B

1234567891011121314151617181920212223242526
  1. <?php
  2. namespace app\admin\controller;
  3. use support\Request;
  4. class Index
  5. {
  6. public function index(Request $request)
  7. {
  8. $data = [1,2,3];
  9. $a = json_encode($data);
  10. return response($a);
  11. }
  12. public function view(Request $request)
  13. {
  14. return view('index/view', ['name' => 'webman']);
  15. }
  16. public function json(Request $request)
  17. {
  18. return json(['code' => 1, 'msg' => 'ok']);
  19. }
  20. }