繁体   English   中英

使用引导程序为HWIOAuth捆绑包创建自定义登录屏幕

[英]Make a custom login screen for the HWIOAuth Bundle using bootstrap

{% 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>

如果有人需要在下面发送评论以编辑答案,则我可以通过这种方式来实现更自定义的登录菜单,并且还对提供者和控制器进行了处理,以对我的用户进行处理。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM