framework/views/index.blade.php
Toby Zerner 822a216cc9 Roughly implement routes and data preloading
Only preloading data for basic requests w/o query params, at least for
the moment - if we have to preload for something like
/?q=test&sort=newest, we end up having to duplicate a whole lot of
logic between JS/PHP.
2015-06-18 17:41:37 +09:30

35 lines
980 B
PHP

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>{{ $title }}</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1">
@foreach ($styles as $file)
<link rel="stylesheet" href="{{ str_replace(public_path(), '', $file) }}">
@endforeach
</head>
<body>
@include($layout)
<div id="modal"></div>
<div id="alerts"></div>
@foreach ($scripts as $file)
<script src="{{ str_replace(public_path(), '', $file) }}"></script>
@endforeach
<script>
var app = require('flarum/app')['default'];
app.config = {!! json_encode($config) !!};
app.preload = {
data: {!! json_encode($data) !!},
response: {!! json_encode($response) !!},
session: {!! json_encode($session) !!}
};
app.boot();
</script>
</body>
</html>