HomeController.php 618 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. namespace App\Http\Controllers;
  3. use App\Services\LiquidRenderer;
  4. use Illuminate\Http\Request;
  5. class HomeController extends Controller
  6. {
  7. function __construct()
  8. {
  9. }
  10. public function index()
  11. {
  12. $cacheKey=getDistId().'-home';
  13. //模板支持多级目录,需要目录符号
  14. $output = LiquidRenderer::render('home.liquid', [
  15. ],$cacheKey);
  16. return response($output);
  17. }
  18. /*
  19. * 404页面
  20. */
  21. public function abort404() {
  22. $output = LiquidRenderer::render('404.liquid', [
  23. ]);
  24. return response($output);
  25. }
  26. }