templates/base.html.twig line 1

Open in your IDE?
  1. {#
  2.    This is the base template used as the application layout which contains the
  3.    common elements and decorates all the other templates.
  4.    See https://symfony.com/doc/current/templates.html#template-inheritance-and-layouts
  5. #}
  6. <!DOCTYPE html>
  7. <html lang="{{ app.request.locale }}">
  8.     <head>
  9.         <meta charset="UTF-8" />
  10.         <meta name="viewport" content="width=device-width, initial-scale=1"/>
  11.         <title>{% block title %}Symfony Demo application{% endblock %}</title>
  12.         <link rel="alternate" type="application/rss+xml" title="{{ 'rss.title'|trans }}" href="{{ path('blog_rss') }}">
  13.         {#
  14.             Those two blocks defines frontend entrypoint for CSS and JavaScript assets
  15.             See https://symfony.com/doc/current/frontend.html
  16.         #}
  17.         {% block stylesheets %}
  18.             {{ encore_entry_link_tags('app') }}
  19.         {% endblock %}
  20.         {% block javascripts %}
  21.             {{ encore_entry_script_tags('app') }}
  22.         {% endblock %}
  23.         <link rel="icon" type="image/x-icon" href="{{ asset('favicon.ico') }}" />
  24.     </head>
  25.     <body id="{% block body_id %}{% endblock %}">
  26.         {% block header %}
  27.             <header>
  28.                 <div class="navbar navbar-default navbar-static-top" role="navigation">
  29.                     <div class="container">
  30.                         <div class="navbar-header col-md-3 col-lg-2">
  31.                             <a class="navbar-brand" href="{{ path('homepage') }}">
  32.                                 Symfony Demo
  33.                             </a>
  34.                             <button type="button" class="navbar-toggle"
  35.                                     data-toggle="collapse"
  36.                                     data-target=".navbar-collapse">
  37.                                 <span class="sr-only">{{ 'menu.toggle_nav'|trans }}</span>
  38.                                 <span class="icon-bar"></span>
  39.                                 <span class="icon-bar"></span>
  40.                                 <span class="icon-bar"></span>
  41.                             </button>
  42.                         </div>
  43.                         <div class="navbar-collapse collapse">
  44.                             <ul class="nav navbar-nav navbar-right">
  45.                                 {% block header_navigation_links %}
  46.                                     <li>
  47.                                         <a href="{{ path('blog_index') }}">
  48.                                             <i class="fa fa-home" aria-hidden="true"></i> {{ 'menu.homepage'|trans }}
  49.                                         </a>
  50.                                     </li>
  51.                                     {% if is_granted('ROLE_ADMIN') %}
  52.                                         <li>
  53.                                             <a href="{{ path('admin_post_index') }}">
  54.                                                 <i class="fa fa-lock" aria-hidden="true"></i> {{ 'menu.admin'|trans }}
  55.                                             </a>
  56.                                         </li>
  57.                                     {% endif %}
  58.                                 {% endblock %}
  59.                                 <li>
  60.                                     <a href="{{ path('blog_search') }}"> <i class="fa fa-search"></i> {{ 'menu.search'|trans }}</a>
  61.                                 </li>
  62.                                 {% if app.user %}
  63.                                     <li class="dropdown">
  64.                                         <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false" id="user">
  65.                                             <i class="fa fa-user" aria-hidden="true"></i>
  66.                                             <span class="caret"></span>
  67.                                             <span class="sr-only">{{ app.user.fullname }}</span>
  68.                                         </a>
  69.                                         <ul class="dropdown-menu user" role="menu" aria-labelledby="user">
  70.                                             <li>
  71.                                                 <a href="{{ path('user_edit') }}">
  72.                                                     <i class="fa fa-edit" aria-hidden="true"></i> {{ 'menu.user'|trans }}
  73.                                                 </a>
  74.                                             </li>
  75.                                             <li class="divider"></li>
  76.                                             <li>
  77.                                                 <a href="{{ logout_path() }}">
  78.                                                     <i class="fa fa-sign-out" aria-hidden="true"></i> {{ 'menu.logout'|trans }}
  79.                                                 </a>
  80.                                             </li>
  81.                                         </ul>
  82.                                     </li>
  83.                                 {% endif %}
  84.                                 <li class="dropdown">
  85.                                     <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false" id="locales">
  86.                                         <i class="fa fa-globe" aria-hidden="true"></i>
  87.                                         <span class="caret"></span>
  88.                                         <span class="sr-only">{{ 'menu.choose_language'|trans }}</span>
  89.                                     </a>
  90.                                     <ul class="dropdown-menu locales" role="menu" aria-labelledby="locales">
  91.                                         {% for locale in locales() %}
  92.                                             <li {% if app.request.locale == locale.code %}aria-checked="true" class="active"{% else %}aria-checked="false"{% endif %} role="menuitem"><a href="{{ path(app.request.get('_route', 'blog_index'), app.request.get('_route_params', [])|merge({_locale: locale.code})) }}">{{ locale.name|capitalize }} <small>{{ locale.code[0:2] }}</small></a></li>
  93.                                         {% endfor %}
  94.                                     </ul>
  95.                                 </li>
  96.                             </ul>
  97.                         </div>
  98.                     </div>
  99.                 </div>
  100.             </header>
  101.         {% endblock %}
  102.         <div class="container body-container">
  103.             {% block body %}
  104.                 <div class="row">
  105.                     <div id="main" class="col-sm-9">
  106.                         {{ include('default/_flash_messages.html.twig') }}
  107.                         {% block main %}{% endblock %}
  108.                     </div>
  109.                     <div id="sidebar" class="col-sm-3">
  110.                         {% block sidebar %}
  111.                             {{ render_esi(controller('Symfony\\Bundle\\FrameworkBundle\\Controller\\TemplateController::templateAction', {
  112.                                 'template': 'blog/about.html.twig',
  113.                                 'sharedAge': 600,
  114.                                 '_locale': app.request.locale
  115.                             })) }}
  116.                         {% endblock %}
  117.                     </div>
  118.                 </div>
  119.             {% endblock %}
  120.         </div>
  121.         {% block footer %}
  122.             <footer>
  123.                 <div class="container">
  124.                     <div class="row">
  125.                         <div id="footer-copyright" class="col-md-6">
  126.                             <p>&copy; {{ 'now'|date('Y') }} - The Symfony Project</p>
  127.                             <p>{{ 'mit_license'|trans }}</p>
  128.                         </div>
  129.                         <div id="footer-resources" class="col-md-6">
  130.                             <p>
  131.                                 <a href="https://twitter.com/symfony" title="Symfony Twitter">
  132.                                     <i class="fa fa-twitter" aria-hidden="true"></i>
  133.                                 </a>
  134.                                 <a href="https://www.facebook.com/SensioLabs" title="SensioLabs Facebook">
  135.                                     <i class="fa fa-facebook" aria-hidden="true"></i>
  136.                                 </a>
  137.                                 <a href="https://symfony.com/blog/" title="Symfony Blog">
  138.                                     <i class="fa fa-rss" aria-hidden="true"></i>
  139.                                 </a>
  140.                             </p>
  141.                         </div>
  142.                     </div>
  143.                 </div>
  144.             </footer>
  145.         {% endblock %}
  146.         {# it's not mandatory to set the timezone in localizeddate(). This is done to
  147.            avoid errors when the 'intl' PHP extension is not available and the application
  148.            is forced to use the limited "intl polyfill", which only supports UTC and GMT #}
  149.         <!-- Page rendered on {{ 'now'|format_datetime('long', 'long', '', 'UTC') }} -->
  150.     </body>
  151. </html>