This repository has been archived on 2026-03-09. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
blog-slim.old/var/cache/twig/47/47cab4dc7982a59d8be24ee5dbfcb55a.php
2026-03-09 14:17:05 +01:00

152 lines
4.9 KiB
PHP

<?php
use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\CoreExtension;
use Twig\Extension\SandboxExtension;
use Twig\Markup;
use Twig\Sandbox\SecurityError;
use Twig\Sandbox\SecurityNotAllowedTagError;
use Twig\Sandbox\SecurityNotAllowedFilterError;
use Twig\Sandbox\SecurityNotAllowedFunctionError;
use Twig\Source;
use Twig\Template;
use Twig\TemplateWrapper;
/* pages/home.twig */
class __TwigTemplate_9471f8175ca69249c24a559aa9930d1d extends Template
{
private Source $source;
/**
* @var array<string, Template>
*/
private array $macros = [];
public function __construct(Environment $env)
{
parent::__construct($env);
$this->source = $this->getSourceContext();
$this->blocks = [
'title' => [$this, 'block_title'],
'content' => [$this, 'block_content'],
];
}
protected function doGetParent(array $context): bool|string|Template|TemplateWrapper
{
// line 1
return "layout.twig";
}
protected function doDisplay(array $context, array $blocks = []): iterable
{
$macros = $this->macros;
$this->parent = $this->load("layout.twig", 1);
yield from $this->parent->unwrap()->yield($context, array_merge($this->blocks, $blocks));
}
// line 3
/**
* @return iterable<null|scalar|\Stringable>
*/
public function block_title(array $context, array $blocks = []): iterable
{
$macros = $this->macros;
yield "Mon Blog";
yield from [];
}
// line 5
/**
* @return iterable<null|scalar|\Stringable>
*/
public function block_content(array $context, array $blocks = []): iterable
{
$macros = $this->macros;
// line 6
$context['_parent'] = $context;
$context['_seq'] = CoreExtension::ensureTraversable(($context["posts"] ?? null));
$context['_iterated'] = false;
foreach ($context['_seq'] as $context["_key"] => $context["post"]) {
// line 7
yield "<article class=\"post\">
<h2>";
// line 8
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["post"], "title", [], "any", false, false, false, 8), "html", null, true);
yield "</h2>
<div class=\"post-meta\">
<small>Publié le ";
// line 11
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Twig\Extension\CoreExtension']->formatDate(CoreExtension::getAttribute($this->env, $this->source, $context["post"], "createdAt", [], "any", false, false, false, 11), "d/m/Y à H:i"), "html", null, true);
yield "</small>
";
// line 12
if ((($tmp = CoreExtension::getAttribute($this->env, $this->source, $context["post"], "isRecent", [7], "method", false, false, false, 12)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
// line 13
yield " <span class=\"badge badge-new\">Nouveau</span>
";
}
// line 15
yield " </div>
<p>";
// line 17
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["post"], "getExcerpt", [200], "method", false, false, false, 17), "html", null, true);
yield "</p>
<p>
<a href=\"/article/";
// line 20
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["post"], "getSlug", [], "method", false, false, false, 20), "html", null, true);
yield "\">Lire la suite →</a>
</p>
</article>
";
$context['_iterated'] = true;
}
// line 23
if (!$context['_iterated']) {
// line 24
yield "<p>Aucun article publié.</p>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_key'], $context['post'], $context['_parent'], $context['_iterated']);
$context = array_intersect_key($context, $_parent) + $_parent;
yield from [];
}
/**
* @codeCoverageIgnore
*/
public function getTemplateName(): string
{
return "pages/home.twig";
}
/**
* @codeCoverageIgnore
*/
public function isTraitable(): bool
{
return false;
}
/**
* @codeCoverageIgnore
*/
public function getDebugInfo(): array
{
return array ( 114 => 24, 112 => 23, 104 => 20, 98 => 17, 94 => 15, 90 => 13, 88 => 12, 84 => 11, 78 => 8, 75 => 7, 70 => 6, 63 => 5, 52 => 3, 41 => 1,);
}
public function getSourceContext(): Source
{
return new Source("", "pages/home.twig", "/home/julien/Documents/Git/julien/blog-slim/views/pages/home.twig");
}
}