develop
HerrHase 3 years ago
parent 5e28b135fc
commit 4ce01e8b99

@ -40,3 +40,16 @@ function asset($path, $prefix = '/public')
return $path;
}
/**
* getting name of view as slug
*
* @param array $page
* @return string
*
*/
function viewName(array $page)
{
$slugify = new \Cocur\Slugify\Slugify();
return $slugify->slugify($page['data']['view']);
}

@ -1,6 +1,5 @@
@inject('pageRepository', 'App\Repositories\PageRepository')
@inject('markdownHelper', 'App\Helpers\MarkdownHelper')
@inject('slugify', 'Cocur\Slugify\Slugify')
<!DOCTYPE html>
<html lang="de-DE" class="no-js">
@ -17,7 +16,7 @@
@stack('head')
</head>
<body class="{{ $slugify->slugify($page['data']['view']) }}">
<body class="{{ viewName($page) }}">
<header class="site-header">
<h1 class="site-header__title">

Loading…
Cancel
Save