承接 sherlockode/user-confirmation-bundle 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

sherlockode/user-confirmation-bundle

最新稳定版本:v1.0.0

Composer 安装命令:

composer require sherlockode/user-confirmation-bundle

包简介

Symfony Bundle for the confirmation process of a user registration

README 文档

README

The SherlockodeUserConfirmationBundle provides a way to create a user account that will stay disabled until the user visits a confirmation link sent by email and sets a password.

Prerequisites

This version of the bundle requires Symfony 7.* and FOSUserBundle

Installation

Step 1: Install SherlockodeUserConfirmationBundle

Install with Composer:

$ composer require sherlockode/user-confirmation-bundle

Enable the bundle in the Symfony kernel:

<?php
// config/bundles.php
return [
    // ...
    Sherlockode\UserConfirmationBundle\SherlockodeUserConfirmationBundle::class => ['all' => true],
];

Step 2: Configure the bundle

Import the routing in config/routes.yaml

sherlockode_user_confirmation:
    resource: "@SherlockodeUserConfirmationBundle/Controller/"
    type: attribute

Then create the configuration in config/packages/sherlockode_user_confirmation.yaml

sherlockode_user_confirmation:
    from_email: no-reply@awesome.com                # From email address
    from_name: John Doe                             # Name of the expeditor
    email_subject: Please confirm your account      # The subject for the confirmation email (optional)
    redirect_after_confirmation: admin_dashboard    # The route name to redirect the user after confirmation

Customization

Extend the confirmation form template

To extend the confirmation form template, just update your sherlockode_user_confirmation.yaml

sherlockode_user_confirmation:
    templates:
        confirmation_form: 'Registration/confirmation.html.twig'

Then in your template, add a placeholder for the block sherlockode_user_confirmation_form

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8" />
</head>
<body>
    <h1>My awesome app !</h1>
    <div>
        {# The form will be render here #}
        {% block sherlockode_user_confirmation_form %}{% endblock %}
    </div>
</body>
</html>

Extend the confirmation email

If you want to extend the confirmation email template, you should add the path in your config.yml

sherlockode_user_confirmation:
    templates:
        confirmation_email: 'Email/registration.html.twig'

In this template, you have access to the user object, and to a variable named confirmationUrl which contains the url to access the confirmation form.

Send confirmation email

If you want to send the confirmation again for an existing user, use the following link :

<a href="{{ path('sherlockode_user_confirmation_send_confirmation', {id: userId}) }}">
    Send confirmation email
</a>

统计信息

  • 总下载量: 3.46k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 4
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 4
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固