v0.1.0
This commit is contained in:
68
frontend/setup/web/settings.php
Normal file
68
frontend/setup/web/settings.php
Normal file
@ -0,0 +1,68 @@
|
||||
<?php
|
||||
use Psr\Container\ContainerInterface as Container;
|
||||
|
||||
return [
|
||||
'login_time' => 5*60*60,
|
||||
'locations' => function() {
|
||||
$arr = ['base' => dirname(__DIR__, 2)];
|
||||
$arr['resources'] = implode(DIRECTORY_SEPARATOR, [
|
||||
$arr['base'],
|
||||
'resources'
|
||||
]);
|
||||
$arr['data'] = implode(DIRECTORY_SEPARATOR, [
|
||||
$arr['resources'],
|
||||
'data'
|
||||
]);
|
||||
$arr['routes'] = implode(DIRECTORY_SEPARATOR, [
|
||||
$arr['resources'],
|
||||
'routes'
|
||||
]);
|
||||
$arr['templates'] = implode(DIRECTORY_SEPARATOR, [
|
||||
$arr['resources'],
|
||||
'views'
|
||||
]);
|
||||
$arr['cache'] = implode(DIRECTORY_SEPARATOR, [
|
||||
$arr['base'],
|
||||
'cache'
|
||||
]);
|
||||
return (object) $arr;
|
||||
},
|
||||
'urls' => function(Container $c) {
|
||||
$arr = ['base' => $c->get('base_url'), 'api' => $_ENV['API_URL']];
|
||||
return (object) $arr;
|
||||
},
|
||||
'scripts' => function() {
|
||||
$arr = [
|
||||
[
|
||||
'full' => '<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js" integrity="sha512-894YE6QWD5I59HgZOGReFYm4dnWc1Qt5NtvYSaNcOP+u1T9qYdvdihz0PPSiiqn/+/3e7Jo4EaG7TubfWGUrMQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>'
|
||||
],
|
||||
[
|
||||
'full' => '<script src="https://cdnjs.cloudflare.com/ajax/libs/fomantic-ui/2.8.7/semantic.min.js" integrity="sha512-1Nyd5H4Aad+OyvVfUOkO/jWPCrEvYIsQENdnVXt1+Jjc4NoJw28nyRdrpOCyFH4uvR3JmH/5WmfX1MJk2ZlhgQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>'
|
||||
]
|
||||
];
|
||||
foreach ($arr as $i => $a) {
|
||||
$arr[$i] = (object) $a;
|
||||
}
|
||||
return $arr;
|
||||
},
|
||||
'styles' => function() {
|
||||
$arr = [
|
||||
[
|
||||
'link' => '<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fomantic-ui/2.8.7/semantic.min.css" integrity="sha512-g/MzOGVPy3OQ4ej1U+qe4D/xhLwUn5l5xL0Fa7gdC258ZWVJQGwsbIR47SWMpRxSPjD0tfu/xkilTy+Lhrl3xg==" crossorigin="anonymous" referrerpolicy="no-referrer" />'
|
||||
],
|
||||
[
|
||||
'url' => 'https://cdnjs.cloudflare.com/ajax/libs/fomantic-ui/2.8.7/themes/default/assets/fonts/brand-icons.woff2'
|
||||
],
|
||||
[
|
||||
'url' => 'https://cdnjs.cloudflare.com/ajax/libs/fomantic-ui/2.8.7/themes/default/assets/fonts/icons.woff2'
|
||||
],
|
||||
[
|
||||
'url' => 'https://cdnjs.cloudflare.com/ajax/libs/fomantic-ui/2.8.7/themes/default/assets/fonts/outline-icons.woff2'
|
||||
]
|
||||
];
|
||||
foreach ($arr as $i => $a) {
|
||||
$arr[$i] = (object) $a;
|
||||
}
|
||||
return $arr;
|
||||
}
|
||||
];
|
17
frontend/setup/web/setups.php
Normal file
17
frontend/setup/web/setups.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
use Psr\Container\ContainerInterface as Container;
|
||||
|
||||
return [
|
||||
Slim\Views\Blade::class => function(Container $container) {
|
||||
return new Slim\Views\Blade(
|
||||
$container->get('locations')->templates,
|
||||
$container->get('locations')->cache,
|
||||
null,
|
||||
[
|
||||
'urls' => $container->get('urls'),
|
||||
'page_styles' => $container->get('styles'),
|
||||
'page_scripts' => $container->get('scripts')
|
||||
]
|
||||
);
|
||||
}
|
||||
];
|
Reference in New Issue
Block a user