Skip to content

Instantly share code, notes, and snippets.

@mrofi
Created January 2, 2015 14:07
Show Gist options
  • Save mrofi/9f1b3199a5247bc843bb to your computer and use it in GitHub Desktop.
Save mrofi/9f1b3199a5247bc843bb to your computer and use it in GitHub Desktop.
App layouts for Laravel View
@extends('layouts.master')
<?php
$route = Route::currentRouteName();
if (!isset($user)) $user = User::find(Session::get('user_id'));
?>
@section('bodystyle') style="padding-top: 0!important;" @stop
@section('menu')
<li class="@if (stristr($route, 'app.new')) active @endif"><a class="btn-info color-white hover-ready" href="/app/new">New Submit</a></li>
<li class="@if (stristr($route, 'all')) active @endif"><a class="" href="/app/all">All Heroes</a></li>
@if(Session::has('user_id'))
<li class="@if (stristr($route, 'post')) active @endif"><a class="" href="/{{ User::find(Session::get('user_id'))->username }}">My Heroes</a></li>
<li><a class="not-link" href="#">|</a></li>
<li><a href="#">Hi, {{User::find(Session::get('user_id'))->nama}}</a></li>
<li class="active"><a class="btn btn-info" href="/app/logout">Logout</a></li>
@endif
@stop
@section('content')
@yield('appcontent')
@stop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment