Last active
August 29, 2015 14:28
-
-
Save raank/abc62d8780272341512c to your computer and use it in GitHub Desktop.
Class Helpers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // file: resources/views/app.blade.php ?> | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>@yield('title') - CMS</title> | |
{!! Html::style('build/css/style.min.css') !!} | |
@yield('page-styles') | |
</head> | |
<body class="@yield('class')"> | |
@if (Route::current()->getName() == 'auth/login') | |
@include('partials.layout.errors') | |
@yield('content') | |
@else | |
<header class="main-header"> | |
@include('partials.layout.navbar') | |
</header> | |
<main class="main-site page"> | |
<div class="had-container"> | |
<div class="row"> | |
<aside class="col l3 md3 hide-on-small-only"> | |
{{ Helpers::sidebar() }}{{-- AQUI EU CHAMO A CLASSE ASIDE --}} | |
</aside> | |
@include('partials.layout.errors') | |
@yield('content') | |
</div> | |
</div> | |
</main> | |
@endif | |
<!-- Scripts --> | |
{!! Html::script('build/js/libs/jquery.min.js') !!} | |
{!! Html::script('build/js/libs/materialize.min.js') !!} | |
@yield('page-script') | |
{!! Html::script('build/js/main.min.js') !!} | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// File config/app.php | |
return [ | |
// ... resto do código | |
'aliases' => [ | |
// ... resto do código | |
'Helpers' => 'App\Helpers\Admin\Aside' | |
], | |
'register' => 'false' | |
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// file: app/Helpers/Admin/Aside.php | |
namespace App\Helpers\Admin; | |
use Route; | |
Class Aside { | |
public function __construct() | |
{ | |
} | |
static function sidebar($route = null) | |
{ | |
echo Route::currentRouteName(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment