mirror of
https://github.com/shlinkio/shlink.git
synced 2024-11-22 00:47:25 -06:00
Migrated templates to plates
This commit is contained in:
parent
453ca1728e
commit
e53ffc8d43
@ -4,6 +4,9 @@ return [
|
||||
|
||||
'templates' => [
|
||||
'extension' => 'phtml',
|
||||
],
|
||||
|
||||
'plates' => [
|
||||
'extensions' => [
|
||||
// extension service names or instances
|
||||
],
|
||||
|
@ -5,7 +5,7 @@ use Shlinkio\Shlink\Common\Template\Extension\TranslatorExtension;
|
||||
|
||||
return [
|
||||
|
||||
'templates' => [
|
||||
'plates' => [
|
||||
'extensions' => [
|
||||
TranslatorExtension::class,
|
||||
],
|
||||
|
@ -1,17 +0,0 @@
|
||||
{% extends 'core/layout/default.html.twig' %}
|
||||
|
||||
{% block title %}{{ translate('URL Not Found') }}{% endblock %}
|
||||
|
||||
{% block stylesheets %}
|
||||
<style>
|
||||
p {margin-bottom: 20px;}
|
||||
body {text-align: center;}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1>{{ translate('Oops!') }}</h1>
|
||||
<hr>
|
||||
<p>{{ translate('This short URL doesn\'t seem to be valid.') }}</p>
|
||||
<p>{{ translate('Make sure you included all the characters, with no extra punctuation.') }}</p>
|
||||
{% endblock %}
|
19
module/Core/templates/error/404.phtml
Normal file
19
module/Core/templates/error/404.phtml
Normal file
@ -0,0 +1,19 @@
|
||||
<?php $this->layout('ShlinkCore::layout/default') ?>
|
||||
|
||||
<?php $this->start('title') ?>
|
||||
<?= $this->translate('URL Not Found') ?>
|
||||
<?php $this->end() ?>
|
||||
|
||||
<?php $this->start('stylesheets') ?>
|
||||
<style>
|
||||
p {margin-bottom: 20px;}
|
||||
body {text-align: center;}
|
||||
</style>
|
||||
<?php $this->end() ?>
|
||||
|
||||
<?php $this->start('main') ?>
|
||||
<h1><?= $this->translate('Oops!') ?></h1>
|
||||
<hr>
|
||||
<p><?= $this->translate('This short URL doesn\'t seem to be valid.') ?></p>
|
||||
<p><?= $this->translate('Make sure you included all the characters, with no extra punctuation.') ?></p>
|
||||
<?php $this->end() ?>
|
@ -1,21 +0,0 @@
|
||||
{% extends 'core/layout/default.html.twig' %}
|
||||
|
||||
{% block title %}{{ status }} {{ reason }}{% endblock %}
|
||||
|
||||
{% block stylesheets %}
|
||||
<style>
|
||||
p {margin-bottom: 20px;}
|
||||
body {text-align: center;}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1>{{ translate('Oops!') }}</h1>
|
||||
<hr>
|
||||
{% if status != 404 %}
|
||||
<p>{{ translate('We encountered a %s %s error.') | format(status, reason) }}</p>
|
||||
{% else %}
|
||||
<p>{{ translate('This short URL doesn\'t seem to be valid.') }}</p>
|
||||
<p>{{ translate('Make sure you included all the characters, with no extra punctuation.') }}</p>
|
||||
{% endif %}
|
||||
{% endblock %}
|
25
module/Core/templates/error/error.phtml
Normal file
25
module/Core/templates/error/error.phtml
Normal file
@ -0,0 +1,25 @@
|
||||
<?php $this->layout('ShlinkCore::layout/default') ?>
|
||||
|
||||
<?php $this->start('title') ?>
|
||||
<?= $this->e($status . ' ' . $reason) ?>
|
||||
<?php $this->end() ?>
|
||||
|
||||
<?php $this->start('stylesheets') ?>
|
||||
<style>
|
||||
p {margin-bottom: 20px;}
|
||||
body {text-align: center;}
|
||||
</style>
|
||||
<?php $this->end() ?>
|
||||
|
||||
<?php $this->start('main') ?>
|
||||
<h1><?= $this->translate('Oops!') ?></h1>
|
||||
<hr>
|
||||
|
||||
<?php if ($status !== 404): ?>
|
||||
<p><?= sprintf($this->translate('We encountered a %s %s error.'), $status, $reason) ?></p>
|
||||
<?php else: ?>
|
||||
<p><?= $this->translate('This short URL doesn\'t seem to be valid.') ?></p>
|
||||
<p><?= $this->translate('Make sure you included all the characters, with no extra punctuation.') ?></p>
|
||||
<?php endif; ?>
|
||||
<?php $this->end() ?>
|
||||
|
@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<title>{% block title %}{% endblock %} | URL shortener</title>
|
||||
<title><?= $this->section('title', '') ?> | URL shortener</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" />
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css" />
|
||||
@ -13,28 +13,30 @@
|
||||
.app-content {flex: 1;}
|
||||
.app-footer p {margin-bottom: 20px;}
|
||||
</style>
|
||||
{% block stylesheets %}{% endblock %}
|
||||
<?= $this->section('stylesheets', '') ?>
|
||||
</head>
|
||||
<body class="app">
|
||||
<div class="app-content">
|
||||
<main class="container">
|
||||
{% block content %}{% endblock %}
|
||||
<?= $this->section('main', '') ?>
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<footer class="app-footer">
|
||||
<div class="container">
|
||||
<hr />
|
||||
{% block footer %}
|
||||
<?php if ($this->section('footer')): ?>
|
||||
<?= $this->section('footer') ?>
|
||||
<?php else: ?>
|
||||
<p>
|
||||
© {{ "now" | date("Y") }} <a href="https://shlink.io">Shlink</a>
|
||||
© <?= date('Y') ?> <a href="https://shlink.io">Shlink</a>
|
||||
</p>
|
||||
{% endblock %}
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
|
||||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
|
||||
{% block javascript %}{% endblock %}
|
||||
<?= $this->section('javascript', '') ?>
|
||||
</body>
|
||||
</html>
|
@ -37,7 +37,7 @@ class PathVersionMiddleware implements MiddlewareInterface
|
||||
$uri = $request->getUri();
|
||||
$path = $uri->getPath();
|
||||
|
||||
// If the path does not begin with the version number, prepend v1 by default for retrocompatibility purposes
|
||||
// If the path does not begin with the version number, prepend v1 by default for BC compatibility purposes
|
||||
if (strpos($path, '/v') !== 0) {
|
||||
$parts = explode('/', $path);
|
||||
// Remove the first empty part and the
|
||||
|
@ -1,9 +1,9 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
use Interop\Container\ContainerInterface;
|
||||
use Zend\Expressive\Application;
|
||||
|
||||
/** @var ContainerInterface $container */
|
||||
$container = include __DIR__ . '/../config/container.php';
|
||||
/** @var Application $app */
|
||||
$app = $container->get(Application::class);
|
||||
$app->run();
|
||||
$app = $container->get(Application::class)->run();
|
||||
|
Loading…
Reference in New Issue
Block a user