使用 bootstrap 为 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>
如果有人需要在下面发送评论来编辑答案,我可以通过这种方式来实现更可定制的登录菜单,也可以使用提供者和控制器来处理我的用户。
{% 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>
如果有人需要在下面发送评论来编辑答案,我可以通过这种方式来实现更可定制的登录菜单,也可以使用提供者和控制器来处理我的用户。