add new demo symfony files

This commit is contained in:
2021-04-17 22:11:27 +02:00
parent fe90d3d32c
commit 92359d6292
194 changed files with 32985 additions and 1 deletions

View File

@@ -0,0 +1,32 @@
{#
This is a template fragment designed to be included in other templates
See https://symfony.com/doc/current/templates.html#including-templates
A common practice to better distinguish between templates and fragments is to
prefix fragments with an underscore. That's why this template is called
'_flash_messages.html.twig' instead of 'flash_messages.html.twig'
#}
{#
The check is needed to prevent starting the session when looking for "flash messages":
https://symfony.com/doc/current/session.html#avoid-starting-sessions-for-anonymous-users
TIP: With FOSHttpCache you can also adapt this to make it cache safe:
https://foshttpcachebundle.readthedocs.io/en/latest/features/helpers/flash-message.html
#}
{% if app.request.hasPreviousSession %}
<div class="messages">
{% for type, messages in app.flashes %}
{% for message in messages %}
{# Bootstrap alert, see https://getbootstrap.com/docs/3.4/components/#alerts #}
<div class="alert alert-dismissible alert-{{ type }} fade in" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="{{ 'action.close'|trans }}">
<span aria-hidden="true">&times;</span>
</button>
{{ message|trans }}
</div>
{% endfor %}
{% endfor %}
</div>
{% endif %}

View File

@@ -0,0 +1,44 @@
{% extends 'base.html.twig' %}
{% block body_id 'homepage' %}
{#
the homepage is a special page which displays neither a header nor a footer.
this is done with the 'trick' of defining empty Twig blocks without any content
#}
{% block header %}{% endblock %}
{% block footer %}{% endblock %}
{% block body %}
<div class="page-header">
<h1>{{ 'title.homepage'|trans|raw }}</h1>
</div>
<div class="row">
<div class="col-sm-6">
<div class="jumbotron">
<p>
{{ 'help.browse_app'|trans|raw }}
</p>
<p>
<a class="btn btn-primary btn-lg" href="{{ path('blog_index') }}">
<i class="fa fa-users" aria-hidden="true"></i> {{ 'action.browse_app'|trans }}
</a>
</p>
</div>
</div>
<div class="col-sm-6">
<div class="jumbotron">
<p>
{{ 'help.browse_admin'|trans|raw }}
</p>
<p>
<a class="btn btn-primary btn-lg" href="{{ path('admin_index') }}">
<i class="fa fa-lock" aria-hidden="true"></i> {{ 'action.browse_admin'|trans }}
</a>
</p>
</div>
</div>
</div>
{% endblock %}