使用bootstrap为HWIOAuth Bundle创建一个自定义登录屏幕


{% extends '::base.html.twig' %}
{% block content %}
    <div>
        {% if is_granted("IS_AUTHENTICATED_REMEMBERED") %}
            {{ 'layout.logged_in_as'|trans({'%username%': app.user.username}, 'FOSUserBundle') }} |
            <a href="{{ path('fos_user_security_logout') }}">
                {{ 'layout.logout'|trans({}, 'FOSUserBundle') }}
            </a>
        {% else %}
            <a href="{{ path('fos_user_security_login') }}">{{ 'layout.login'|trans({}, 'FOSUserBundle') }}</a>
        {% endif %}
    </div>
    {% for type, messages in app.session.flashBag.all %}
        {% for message in messages %}
            <div class="{{ type }}">
                {{ message|trans({}, 'FOSUserBundle') }}
            </div>
        {% endfor %}
    {% endfor %}
    <div>
        {% block fos_user_content %}
        {% endblock fos_user_content %}
    </div>
{% endblock %}

目前我的屏幕上有一个外观只是出现按钮登录与facebook或gmail,像一个例子,如何做一个更可视化的屏幕与图标登录和集中。

谢谢。

            <div class="customBtn"><a href="{{ path('hwi_oauth_service_redirect', {'service': 'facebook'}) }}">
                    {% image 'bundles/delivveweb/images/Facebook.png' %}
                    <img src="{{ asset_url }}">
                    {% endimage %}
                </a></div>
            <div class="customBtn"><a href="{{ path('hwi_oauth_service_redirect', {'service': 'google'}) }}">
                    {% image 'bundles/delivveweb/images/Google.png' %}
                    <img src="{{ asset_url }}">
                    {% endimage %}
                </a></div>
            <div class="customBtn"><a href="{{ path('hwi_oauth_service_redirect', {'service': 'linkedin'}) }}">
                    {% image 'bundles/delivveweb/images/in.png' %}
                    <img src="{{ asset_url }}">
                    {% endimage %}
                </a></div>

我可以这样做,是一个更可定制的登录菜单也做了一个提供者和一个控制器,使我的用户的处理,如果有人需要在下面发送评论来编辑答案。

相关内容

最新更新