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/views/post_form.twig
julien 69d8c1bc22 doc
2026-02-22 16:13:36 +01:00

31 lines
897 B
Twig
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{% extends "layout.twig" %}
{% block title %}
{% if post is defined %}Éditer larticle{% else %}Créer un article{% endif %}
{% endblock %}
{% block content %}
<h2>
{% if post is defined %}Éditer{% else %}Créer{% endif %} un article
</h2>
<form method="post" action="{{ action }}">
<p>
<label>Titre<br>
<input type="text" name="title"
value="{{ post.title|default('') }}" required>
</label>
</p>
<p>
<label>Contenu<br>
<textarea name="content" rows="6" required>{{ post.content|default('') }}</textarea>
</label>
</p>
<button type="submit">
{% if post is defined %}Mettre à jour{% else %}Enregistrer{% endif %}
</button>
</form>
<p><a href="/admin">Retour à ladmin</a></p>
{% endblock %}