dongtang5229 2013-11-08 15:12
浏览 57

Laravel 4与HTML5历史

How can I utilize HTML5 history with Laravel 4? Here is my blade content file:

@extends('main')

@section('content')
   This is content.
@endsection

I was thinking to only load the content part in HTML5 history by putting:

@if($showMain)
@extends('main')
@endif

But it doesn't work. The @extends has to be the very first line of the file. I was thinking of putting a few @if($showMain) in the main file. But this way will make the code messy and less maintainable. So, how can I archive that with a cleaner way in Laravel blade? Or, is there a better way to do HTML5 history with Laravel?

Thanks.

  • 写回答

1条回答 默认 最新

  • duancenxiao0482 2013-11-08 15:14
    关注

    History can only be accessed via client-side Javascript code, so there's no way to access that in Laravel which is run server-side.

    What you can do though is keep track of the page history on the server's side using sessions.

    评论

报告相同问题?

悬赏问题

  • ¥100 求数学坐标画圆以及直线的算法
  • ¥35 平滑拟合曲线该如何生成
  • ¥100 c语言,请帮蒟蒻写一个题的范例作参考
  • ¥15 名为“Product”的列已属于此 DataTable
  • ¥15 安卓adb backup备份应用数据失败
  • ¥15 eclipse运行项目时遇到的问题
  • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
  • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
  • ¥15 自己瞎改改,结果现在又运行不了了
  • ¥15 链式存储应该如何解决