심포니 블로그 튜토리얼 http://tutorial.symblog.co.uk/index.html을 통해 인증을 요구하도록 확장하려고했습니다. 나는 느슨하게 http://symfony.com/doc/current/cookbook/security/entity_provider.html을 따라 새로운 번들을 만들었고 (나는 이것을 공통 영역으로 추출하고 싶다) 모든 것이 잘 작동했다. 유일한 문제는 로그인 페이지에서 심포니 툴바를 보여주지 않는다는 것입니다 (다른 곳에서도 마찬가지입니다).하지만 예상대로 나머지 페이지가 표시됩니다.로그인시 심포니 툴바가 누락되었습니다
아이디어가 있으십니까? 미리 감사드립니다.
내 login.html.twig :
{% extends '::base.html.twig' %}
{% block title %}Please Login{% endblock %}
{% block body %}
{% if error %}
<div class="error-message">{{ error.message }}</div>
{% endif %}
<form action="{{ path('login_check') }}" method="post">
<label for="username">E-mail address:</label>
<input type="text" id="username" name="_username" value="{{ last_username }}"/>
<label for="password">Password:</label>
<input type="password" id="password" name="_password"/>
{#
If you want to control the URL the user
is redirected to on success (more details below)
<input type="hidden" name="_target_path" value="/account" />
#}
<button type="submit">login</button>
</form>
{% endblock %}
내 :: base.html.twig :
<!-- app/Resources/views/base.html.twig -->
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html"
; charset=utf-8" />
<title>{% block title %}symblog{% endblock %} - symblog</title>
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
{% block stylesheets %}
<link href='http://fonts.googleapis.com/css?family=Irish+Grover' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=La+Belle+Aurore' rel='stylesheet' type='text/css'>
<link href="{{ asset('css/screen.css') }}" type="text/css" rel="stylesheet"/>
{% endblock %}
<link rel="shortcut icon" href="{{ asset('favicon.ico') }}"/>
</head>
<body>
<section id="wrapper">
<header id="header">
<div class="top">
{% block navigation %}
<nav>
<ul class="navigation">
<li><a href="{{ path('BloggerBlogBundle_homepage') }}">Home</a></li>
<li><a href="{{ path('BloggerBlogBundle_about') }}">About</a></li>
<li><a href="{{ path('BloggerBlogBundle_contact') }}">Contact</a></li>
{% if app.user %}
<li><a href="{{ path('logout') }}">Logout {{ app.user.username }}</a></li>
{% endif %}
</ul>
</nav>
{% endblock %}
</div>
<h2>{% block blog_title %}<a href="{{ path('BloggerBlogBundle_homepage') }}">symblog</a>{% endblock %}</h2>
<h3>{% block blog_tagline %}<a href="{{ path('BloggerBlogBundle_homepage') }}">creating a blog in
Symfony2</a>{% endblock %}</h3>
</header>
<section class="main-col">
{% block body %}{% endblock %}
</section>
<aside class="sidebar">
{% block sidebar %}{% endblock %}
</aside>
<div id="footer">
{% block footer %}
Symfony2 blog tutorial - created by <a href="https://github.com/dsyph3r">dsyph3r</a>
{% endblock %}
</div>
</section>
{% block javascripts %}{% endblock %}
</body>
</html>
완전한 HTML 페이지가 생성되지 않으면 스크롤 막대가 표시되지 않습니다. 브라우저에서 control-u를하십시오. 나는 당신이 어떤 html을보고 아마 오류 메시지가 나올 것을 기대한다. 차례 차례로 문제를 지적 할 수 있습니다. – Cerad
아무것도 잘리지 않습니다. 툴바가 액세스 아래 제대로 설정되지 않았기 때문에 그것이 들리는 것을 들었지만, 어떻게해야하는지 완전히 모르겠습니다. 여기에 내 security.yml : – Derek