Ошибка рендеринга шаблонизатора

Обнаружена проблема при обработке шаблона.

Сообщение об ошибке

An exception has been thrown during the compilation of a template ("Function csrf_meta not found") in "forget.html".
Файл:
/home/arcana_web/web/arcana-mace.pro/public_html/vendor/twig/twig/src/Environment.php
Строка:
557
Тип:
Twig\Error\SyntaxError
Шаблон:
forget.html
  1. return $this->compile($this->parse($this->tokenize($source)));
  2. } catch (Error $e) {
  3. $e->setSourceContext($source);
  4. throw $e;
  5. } catch (\Exception $e) {
  6. throw new SyntaxError(sprintf('An exception has been thrown during the compilation of a template ("%s").', $e->getMessage()), -1, $source, $e);
  7. }
  8. }
  9. public function setLoader(LoaderInterface $loader)
  10. {
  1. <!DOCTYPE html>
  2. <html lang="en" dir="ltr" data-nav-layout="vertical" data-theme-mode="light" data-header-styles="light" data-menu-styles="light" data-toggled="close">
  3. <head>
  4. <!-- Meta Data -->
  5. <meta charset="UTF-8">
  6. <meta name='viewport' content='width=device-width, initial-scale=1.0'>
  7. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  8. <title> {{ phrase(67) }} </title>
  9. <meta name="Description" content="Bootstrap Responsive Admin Web Dashboard HTML5 Template">
  10. <meta name="Author" content="Spruko Technologies Private Limited">
  11. <meta name="keywords" content="admin dashboard,dashboard design htmlbootstrap admin template,html admin panel,admin dashboard html,admin panel html template,bootstrap dashboard,html admin template,html dashboard,html admin dashboard template,bootstrap dashboard template,dashboard html template,bootstrap admin panel,dashboard admin bootstrap,bootstrap admin dashboard">
  12. {{ csrf_meta() }}
  13. <!-- Favicon -->
  14. {{ config().logo().favicon() }}
  15. <!-- Main Theme Js -->
  16. <script src="{{template}}assets/js/authentication-main.js"></script>
  17. <!-- Bootstrap Css -->
  18. <link id="style" href="{{template}}assets/libs/bootstrap/css/bootstrap.min.css" rel="stylesheet" >
  19. <!-- Style Css -->
  20. <link href="{{template}}assets/css/styles.min.css" rel="stylesheet" >
  21. <!-- Icons Css -->
  22. <link href="{{template}}assets/css/icons.min.css" rel="stylesheet" >
  23. <!-- jQuery -->
  24. <script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
  25. {{ config().other().getAnalyticsHead()|raw }}
  26. </head>
  27. <body>
  28. {{ config().other().getAnalyticsBody()|raw }}
  29. {%include 'notice_toast.html'%}
  30. <div {%if config().background().forget()%}
  31. style="background-image: url('{{config().background().forget()}}'); background-size: cover; background-repeat: no-repeat; background-position: center center;"
  32. {%else%}class="autentication-bg"{%endif%}>
  33. <div class="container-lg">
  34. <div class="row justify-content-center authentication authentication-basic align-items-center h-100">
  35. <div class="col-xxl-4 col-xl-5 col-lg-5 col-md-6 col-sm-8 col-12">
  36. <div class="my-4 d-flex justify-content-center">
  37. <a href="/main">
  38. <img src="{{config().logo().getLogo()}}" alt="logo">
  39. </a>
  40. </div>
  41. <div class="card custom-card">
  42. <form id="authForm" action="/forget/create" method="POST" class="card-body">
  43. <p class="h5 fw-semibold mb-2 text-center">{{ phrase(67) }}</p>
  44. <p class="mb-4 text-muted op-7 fw-normal text-center">{{ phrase('enter_email_reset_link') }}</p>
  45. <div class="row gy-3">
  46. <div class="col-xl-12">
  47. <label for="email" class="form-label text-default">Email</label>
  48. <input required name="email" type="text" class="form-control form-control-lg" id="email" placeholder="example@example.com">
  49. </div>
  50. {%if config().captcha().isGoogleCaptcha()%}
  51. <div id="g-recaptcha"></div>
  52. {%elseif config().captcha().isCloudflareCaptcha()%}
  53. <div id="cf-turnstile" class="cf-turnstile"></div>
  54. <input type="hidden" id="cf-turnstile-response" name="cf-turnstile-response">
  55. {%elseif config().captcha().isDefaultCaptcha()%}
  56. <script async defer src="https://js.hcaptcha.com/1/api.js?hl={{getUser().getLang()}}"></script>
  57. <div class="h-captcha text-center" data-sitekey="0c545d06-4fe6-45d4-b704-7b809af8db9c"></div>
  58. {%endif%}
  59. {{ csrf_field() }}
  60. <div class="col-xl-12 d-grid mt-2">
  61. <button id="forget" class="btn btn-lg btn-primary">{{ phrase(364) }}</button>
  62. </div>
  63. <div class="text-center">
  64. <p class="fs-12 text-danger mt-3 mb-0">{{ phrase('send_email_address') }}</p>
  65. </div>
  66. </div>
  67. <div class="text-center my-1 authentication-barrier">
  68. <span><i class="ti ti-lock"></i></span>
  69. </div>
  70. <div class="btn-list text-center">
  71. <a href="/login" aria-label="button" class="btn btn-primary-transparent">
  72. {{ phrase('authorization') }}
  73. </a>
  74. <a href="/signup" aria-label="button" class="btn btn-primary-transparent">
  75. {{ phrase('menu_registration') }}
  76. </a>
  77. </div>
  78. </form>
  79. <div class="text-center">
  80. {%for lang in getAllowLang(false)%}
  81. <a class="align-items-center" href="{{action('user_lang', [lang.lang])}}">
  82. <span class="avatar avatar-xs lh-1 me-0">
  83. <img src="/uploads/images/flags/{{lang.lang}}.png" alt="img">
  84. </span>
  85. </a>
  86. {%endfor%}
  87. </div>
  88. </div>
  89. </div>
  90. </div>
  91. </div>
  92. </div>
  93. <!-- Bootstrap JS -->
  94. <script src="{{template}}assets/libs/bootstrap/js/bootstrap.bundle.min.js"></script>
  95. <script src="{{template}}/assets/libs/@popperjs/core/umd/popper.min.js"></script>
  96. <script src="{{template}}/assets/js/Toasts.js"></script>
  97. <script src="{{template}}/assets/js/general.js"></script>
  98. {%if config().captcha().isEnabled()%}
  99. <script>
  100. var captcha = "{{config().captcha().getCaptcha()}}";
  101. document.addEventListener('DOMContentLoaded', function() {
  102. function get_captcha() {
  103. // Проверяем, какая капча используется
  104. if (captcha === "google") {
  105. grecaptcha.reset();
  106. } else if (captcha === "default") {
  107. // Сброс hCaptcha
  108. if (typeof hcaptcha !== 'undefined') {
  109. hcaptcha.reset();
  110. }
  111. } else if (captcha === "cloudflare") {
  112. // Сброс Cloudflare Turnstile
  113. if (typeof turnstile !== 'undefined') {
  114. turnstile.reset();
  115. }
  116. }
  117. }
  118. // Делаем функцию доступной глобально
  119. window.get_captcha = get_captcha;
  120. });
  121. </script>
  122. {%if config().captcha().isGoogleCaptcha()%}
  123. <script src="https://www.google.com/recaptcha/api.js"></script>
  124. <script>
  125. window.onload = function () {
  126. if (typeof grecaptcha !== 'undefined') {
  127. grecaptcha.render('g-recaptcha', {
  128. 'sitekey': '{{ google_secret_key() }}'
  129. });
  130. } else {
  131. console.error('grecaptcha is not defined');
  132. }
  133. };
  134. </script>
  135. {%elseif config().captcha().isDefaultCaptcha()%}
  136. {%elseif config().captcha().isCloudflareCaptcha()%}
  137. <script src="https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit"></script>
  138. <script>
  139. // Инициализация Cloudflare Turnstile
  140. window.onload = function() {
  141. turnstile.render('#cf-turnstile', {
  142. sitekey: '{{config().captcha().getCloudflareSiteKey()}}',
  143. callback: function(token) {
  144. document.getElementById('cf-turnstile-response').value = token;
  145. }
  146. });
  147. };
  148. </script>
  149. {%endif%}
  150. {%endif%}
  151. <!-- CSRF Protection Script -->
  152. <script src="{{template}}/assets/js/csrf.js"></script>
  153. </body>
  154. </html>
/home/arcana_web/web/arcana-mace.pro/public_html/vendor/twig/twig/src/Environment.php (строка 382)
Twig\Environment->compileSource()
/home/arcana_web/web/arcana-mace.pro/public_html/vendor/twig/twig/src/Environment.php (строка 344)
Twig\Environment->loadTemplate()
/home/arcana_web/web/arcana-mace.pro/public_html/src/template/tpl.php (строка 2686)
Twig\Environment->load()
/home/arcana_web/web/arcana-mace.pro/public_html/src/route/route_registry.php (строка 47)
Ofey\Logan22\template\tpl::display()
[Внутренняя функция]
{closure}()
/home/arcana_web/web/arcana-mace.pro/public_html/vendor/bramus/router/src/Bramus/Router/Router.php (строка 430)
call_user_func_array()
/home/arcana_web/web/arcana-mace.pro/public_html/vendor/bramus/router/src/Bramus/Router/Router.php (строка 416)
Bramus\Router\Router->invoke()
/home/arcana_web/web/arcana-mace.pro/public_html/vendor/bramus/router/src/Bramus/Router/Router.php (строка 280)
Bramus\Router\Router->handle()
/home/arcana_web/web/arcana-mace.pro/public_html/src/route/route_registry.php (строка 123)
Bramus\Router\Router->run()
/home/arcana_web/web/arcana-mace.pro/public_html/index.php (строка 11)
require('/home/arcana_web/web/arcana-ma...')

Переменные доступные в шаблоне:

__route__ (string)
"/forget"
dir (string)
""
protocol (string)
"https"
path (string)
""
template (string)
"/src/template/sphere/"
pointTime (string)
"0.11"

Возможные решения

Проверьте синтаксис и логику шаблона.
Убедитесь, что все переменные и функции определены и доступны.
Проверьте, не используются ли устаревшие методы или функции.