diff --git a/config/autoload/templates.global.php b/config/autoload/templates.global.php index cf8e404b..24296d41 100644 --- a/config/autoload/templates.global.php +++ b/config/autoload/templates.global.php @@ -4,6 +4,9 @@ return [ 'templates' => [ 'extension' => 'phtml', + ], + + 'plates' => [ 'extensions' => [ // extension service names or instances ], diff --git a/module/Common/config/templates.config.php b/module/Common/config/templates.config.php index 37a6714d..eb25ef78 100644 --- a/module/Common/config/templates.config.php +++ b/module/Common/config/templates.config.php @@ -5,7 +5,7 @@ use Shlinkio\Shlink\Common\Template\Extension\TranslatorExtension; return [ - 'templates' => [ + 'plates' => [ 'extensions' => [ TranslatorExtension::class, ], diff --git a/module/Core/templates/error/404.html.twig b/module/Core/templates/error/404.html.twig deleted file mode 100644 index fe36f047..00000000 --- a/module/Core/templates/error/404.html.twig +++ /dev/null @@ -1,17 +0,0 @@ -{% extends 'core/layout/default.html.twig' %} - -{% block title %}{{ translate('URL Not Found') }}{% endblock %} - -{% block stylesheets %} - -{% endblock %} - -{% block content %} -
{{ translate('This short URL doesn\'t seem to be valid.') }}
-{{ translate('Make sure you included all the characters, with no extra punctuation.') }}
-{% endblock %} diff --git a/module/Core/templates/error/404.phtml b/module/Core/templates/error/404.phtml new file mode 100644 index 00000000..369a168b --- /dev/null +++ b/module/Core/templates/error/404.phtml @@ -0,0 +1,19 @@ +layout('ShlinkCore::layout/default') ?> + +start('title') ?> + = $this->translate('URL Not Found') ?> +end() ?> + +start('stylesheets') ?> + +end() ?> + +start('main') ?> += $this->translate('This short URL doesn\'t seem to be valid.') ?>
+= $this->translate('Make sure you included all the characters, with no extra punctuation.') ?>
+end() ?> diff --git a/module/Core/templates/error/error.html.twig b/module/Core/templates/error/error.html.twig deleted file mode 100644 index 5cb66c57..00000000 --- a/module/Core/templates/error/error.html.twig +++ /dev/null @@ -1,21 +0,0 @@ -{% extends 'core/layout/default.html.twig' %} - -{% block title %}{{ status }} {{ reason }}{% endblock %} - -{% block stylesheets %} - -{% endblock %} - -{% block content %} -{{ translate('We encountered a %s %s error.') | format(status, reason) }}
- {% else %} -{{ translate('This short URL doesn\'t seem to be valid.') }}
-{{ translate('Make sure you included all the characters, with no extra punctuation.') }}
- {% endif %} -{% endblock %} diff --git a/module/Core/templates/error/error.phtml b/module/Core/templates/error/error.phtml new file mode 100644 index 00000000..6d22ed9f --- /dev/null +++ b/module/Core/templates/error/error.phtml @@ -0,0 +1,25 @@ +layout('ShlinkCore::layout/default') ?> + +start('title') ?> + = $this->e($status . ' ' . $reason) ?> +end() ?> + +start('stylesheets') ?> + +end() ?> + +start('main') ?> += sprintf($this->translate('We encountered a %s %s error.'), $status, $reason) ?>
+ += $this->translate('This short URL doesn\'t seem to be valid.') ?>
+= $this->translate('Make sure you included all the characters, with no extra punctuation.') ?>
+ +end() ?> + diff --git a/module/Core/templates/layout/default.html.twig b/module/Core/templates/layout/default.phtml similarity index 70% rename from module/Core/templates/layout/default.html.twig rename to module/Core/templates/layout/default.phtml index 4b405c5b..802bf466 100644 --- a/module/Core/templates/layout/default.html.twig +++ b/module/Core/templates/layout/default.phtml @@ -3,7 +3,7 @@ -