IndexController.php 506 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace app\controller;
  3. use support\Request;
  4. class IndexController
  5. {
  6. public function index(Request $request)
  7. {
  8. static $readme;
  9. if (!$readme) {
  10. $readme = file_get_contents(base_path('README.md'));
  11. }
  12. return $readme;
  13. }
  14. public function view(Request $request)
  15. {
  16. return view('index/view', ['name' => 'webman']);
  17. }
  18. public function json(Request $request)
  19. {
  20. return json(['code' => 0, 'msg' => 'ok']);
  21. }
  22. }