Estructura central
This commit is contained in:
24
bootstrap/web/config.php
Normal file
24
bootstrap/web/config.php
Normal file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
return [
|
||||
'folders.templates' => DI\string(implode(DIRECTORY_SEPARATOR, [
|
||||
'{folders.resources}',
|
||||
'views'
|
||||
])),
|
||||
'folders.cache' => DI\string(implode(DIRECTORY_SEPARATOR, [
|
||||
'{folders.base}',
|
||||
'cache'
|
||||
])),
|
||||
'urls.assets' => DI\string(implode(DIRECTORY_SEPARATOR, [
|
||||
'{urls.base}',
|
||||
'assets'
|
||||
])),
|
||||
'urls.styles' => DI\string(implode(DIRECTORY_SEPARATOR, [
|
||||
'{urls.assets}',
|
||||
'styles'
|
||||
])),
|
||||
'file.visits' => DI\string(implode(DIRECTORY_SEPARATOR, [
|
||||
'{folders.data}',
|
||||
'visitas.json'
|
||||
])),
|
||||
'visits.time' => 12 * 60 * 60
|
||||
];
|
2
bootstrap/web/middleware.php
Normal file
2
bootstrap/web/middleware.php
Normal file
@ -0,0 +1,2 @@
|
||||
<?php
|
||||
$app->add(new ProVM\KI\Common\Middleware\Visits($app->getContainer()->get('file.visits'), $app->getContainer()->get('visits.time')));
|
59
bootstrap/web/setup.php
Normal file
59
bootstrap/web/setup.php
Normal file
@ -0,0 +1,59 @@
|
||||
<?php
|
||||
use Psr\Container\ContainerInterface as Container;
|
||||
|
||||
return [
|
||||
'urls' => function(Container $c) {
|
||||
return (object) [
|
||||
'base' => $c->get('base_url'),
|
||||
'facebook' => '',
|
||||
'linkedin' => '',
|
||||
'twitter' => '',
|
||||
'youtube' => ''
|
||||
];
|
||||
},
|
||||
'assets' => function(Container $c) {
|
||||
return (object) [
|
||||
'styles' => [
|
||||
'https://cdnjs.cloudflare.com/ajax/libs/fomantic-ui/2.8.4/semantic.min.css',
|
||||
implode(DIRECTORY_SEPARATOR, [
|
||||
$c->get('urls.styles'),
|
||||
'main.css'
|
||||
])
|
||||
],
|
||||
'fonts' => [
|
||||
'text/css' => [
|
||||
'https://fonts.googleapis.com/css2?family=Roboto:wght@300;900&display=swap',
|
||||
'https://cdnjs.cloudflare.com/ajax/libs/fomantic-ui/2.8.4/themes/default/assets/fonts/brand-icons.woff',
|
||||
'https://cdnjs.cloudflare.com/ajax/libs/fomantic-ui/2.8.4/themes/default/assets/fonts/brand-icons.woff2',
|
||||
'https://cdnjs.cloudflare.com/ajax/libs/fomantic-ui/2.8.4/themes/default/assets/fonts/icons.woff',
|
||||
'https://cdnjs.cloudflare.com/ajax/libs/fomantic-ui/2.8.4/themes/default/assets/fonts/icons.woff2',
|
||||
'https://cdnjs.cloudflare.com/ajax/libs/fomantic-ui/2.8.4/themes/default/assets/fonts/outline-icons.woff',
|
||||
'https://cdnjs.cloudflare.com/ajax/libs/fomantic-ui/2.8.4/themes/default/assets/fonts/outline-icons.woff2'
|
||||
]
|
||||
],
|
||||
'scripts' => [
|
||||
'https://cdnjs.cloudflare.com/ajax/libs/fomantic-ui/2.8.4/semantic.min.js'
|
||||
]
|
||||
];
|
||||
},
|
||||
'visitas' => function(Container $c) {
|
||||
$filename = implode(DIRECTORY_SEPARATOR, [
|
||||
$c->get('folders.data'),
|
||||
'visitas.json'
|
||||
]);
|
||||
$file = json_decode(trim(file_get_contents($filename)));
|
||||
return $file->visits;
|
||||
},
|
||||
Slim\Views\Blade::class => function(Container $c) {
|
||||
return new Slim\Views\Blade(
|
||||
$c->get('folders.templates'),
|
||||
$c->get('folders.cache'),
|
||||
null,
|
||||
[
|
||||
'page_language' => $c->get('language'),
|
||||
'urls' => $c->get('urls'),
|
||||
'assets' => $c->get('assets')
|
||||
]
|
||||
);
|
||||
}
|
||||
];
|
Reference in New Issue
Block a user