Powoli wdrażam się w symfony2 i przeróżne bundle. W tym momencie nieco się zaciąłem na FOSUserBundle, a mianowicie chciałbym dodać na każdej stronie oprócz strony logowania mini formularz logowania podobny w działaniu do tego na forum.
Wiem jak nadpisać bazową templatke wszystkich formularzy z bundla
Układ templatek
Kod
MyBundle
Resources
views
Default
menu.twig.html
base.html.twig
layout.html.twig
layout.html.twig
{% extends 'MyBundle::Base.html.twig' %}
{% block content %}
{% block fos_user_content %}{% endblock %}
{% endblock %}
base.html.twig
<!DOCTYPE html>
<!--[if lt IE 7]>
<html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]>
<html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]>
<html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js" lang="pl"> <!--<![endif]--> <meta name="viewport" content="width=device-width"/> <meta name="description" content="{% trans %}description{% endtrans %}"/> {% block css %}
{% stylesheets '@MyBundle/Resources/css/*' output='public/css/style.css'%}
<link href="{{ asset_url }}" type="text/css" rel="stylesheet"/> {% endstylesheets %}
{% endblock %}
<header class="row">
{% include 'MyBundle:Default:menu.html.twig' %}
</header>
<div class="twelve columns" role="content"> {% block content %}
{% endblock %}
{% block footer %}
<footer class="row">
<div class="twelve columns"> <div class="six columns"> <p>© Copyright no one at all. Go to town.
</p> </footer>
{% endblock %}
MyBundle:
<?php
namespace MyBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class MyBundle extends Bundle
{
public function getParent()
{
return 'FOSUserBundle';
}
}
W jaki sposób mogę dodać do templatki menu (aktualnie pusta) w pełni funkcjonalny formularz do logowania?