Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions app/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
'path' => isset($_ENV['docker']) ? 'php://stdout' : __DIR__ . '/../logs/app.log',
'level' => Logger::DEBUG,
],
'twig' => [
'baseUrl' => 'https://phpminds-assets.s3.eu-west-1.amazonaws.com/public',
],
],
]);
};
11 changes: 8 additions & 3 deletions public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use App\Application\Handlers\ShutdownHandler;
use App\Application\ResponseEmitter\ResponseEmitter;
use Bref\Context\Context;
use DI\Container;
use DI\ContainerBuilder;
use Slim\Factory\AppFactory;
use Slim\Factory\ServerRequestCreatorFactory;
Expand Down Expand Up @@ -34,11 +35,15 @@
$repositories($containerBuilder);

// Build PHP-DI Container instance
/** @var \DI\Container $container */
$container = $containerBuilder->build();
// Set view in Container
$container->set('view', function() {
return Twig::create(__DIR__ . '/../templates', ['cache' => false ]);
// return Twig::create(__DIR__ . '/../templates', ['cache' => __DIR__ . '/../var/cache']);
$container->set('view', function(Container $container) {
$twigSettings = $container->get('settings')['twig'];
$twig = Twig::create(__DIR__ . '/../templates', ['cache' => false]);
$twig->getEnvironment()->addGlobal('baseUrl', $twigSettings['baseUrl']);

return $twig;
});

// Instantiate the app
Expand Down
7 changes: 3 additions & 4 deletions templates/home/sponsors.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,13 @@

<a href="http://rebelrecruitment.co.uk">
<img class="transform absolute py-40 px-8 w-40 md:w-60 md:py-30 lg:w-80 lg:relative
hover:scale-110 motion-reduce:transform-none
"src="img/rebel.svg" alt="Rebel Recruitment">
hover:scale-110 motion-reduce:transform-none" src="{{ baseUrl }}/img/rebel.svg" alt="Rebel Recruitment">

</a>
<a href="http://wearejh.com/">
<img class="transform absolute py-10 px-8 w-40 md:w-60 md:py-5 lg:w-80 lg:relative
hover:scale-110 motion-reduce:transform-none
"src="img/JH-Logo–Colour–RGB.svg" alt="JH Nottingham" >
hover:scale-110 motion-reduce:transform-none"
src="{{ baseUrl }}/img/JH-Logo–Colour–RGB.svg" alt="JH Nottingham" >
</a>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions templates/layout.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>PHPMiNDS | {% block title %}{% endblock %}</title>
<link rel="stylesheet" href="/css/styles.css">
<link rel="stylesheet" href="{{ baseUrl }}/css/styles.css">
<script src="https://kit.fontawesome.com/7f5b3541c5.js" crossorigin="anonymous"></script>
</head>
<body class="bg-bg-green text-white min-h-screen pt-48 relative pb-20">
Expand All @@ -13,7 +13,7 @@
<!-- Header LHS - Logo-->
<div class="flex-shrink-0 " >
<a href="/">
<img class="h-28" src="/img/phpminds-banner.svg/" alt="PHPMinds usergroup logo">
<img class="h-28" src="{{ baseUrl }}/img/phpminds-banner.svg" alt="PHPMinds usergroup logo">
</a>
</div>

Expand Down