inem0o/user-password-lost-bundle 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

inem0o/user-password-lost-bundle

Composer 安装命令:

composer require inem0o/user-password-lost-bundle

包简介

A user password recovery bundle for Symfony3

关键字:

README 文档

README

NOTE: The bundle is compatible with Symfony 3.0 upwards.

1 . Download this bundle to your project first. The preferred way to do it is to use Composer package manager:

"require": {
    "inem0o/user-password-lost-bundle": "dev-master"
}

2 . Configure kernel:

// app/AppKernel.php
public function registerBundles()
{
    $bundles = array(
        // ...
        new inem0o\UserPasswordLostBundle\UserPasswordLostBundle(),
        // ...
    );
}

3 . Configure bundle :

# app/config/config.yml
  user_password_lost:
      user_repo_name: "AppBundle:User"
      user_email_column_name: "email"

      email_from: "contact@site.net"

      route_to_redirect_on_failure: "homepage"
      route_to_redirect_on_success: "login"

      display_success_flashbag: true

      forms:
            constraints:
                    - {form_name: form_password_request, field: user_email, class: Symfony\Component\Validator\Constraints\NotBlank, params: {message: 'Email field cannot be blank'}}

4 . Configure routes :

# app/config/routing.yml
user_password_lost:
  resource: "@UserPasswordLostBundle/Resources/config/routing.yml"
  prefix:   /

4 . Override templates :

Copy all templates from

./vendor/inem0o/user-password-lost-bundle/inem0o/UserPasswordLostBundle/Resources/views/*

into the folder

./app/Resources/UserPasswordLostBundle/views

5 . Override translations :

Copy all translation files from

./vendor/inem0o/user-password-lost-bundle/inem0o/UserPasswordLostBundle/Resources/translations/userPasswordLostBundle.*.xliff

into the folder

./app/Resources/translations/userPasswordLostBundle.*.xliff

Events

The UserPasswordLostBundle dispatches an event when the reset has been successful : inem0o.userpasswordlostbundle.successful_reset The event contains the user who requested a new password, accessible with a $event->getUser() getter. You have to register a listener in order to catch it.

Example : (Considering you named your event PasswordResetSuccessListener and your callback method onSuccessfulReset)

# src/Acme/AppBundle/Resources/config/services.yml
acme.user.reset_password_success.listener:
        class: Acme\AppBundle\EventListener\PasswordResetSuccessListener
        tags:
          - { name: kernel.event_listener, event: inem0o.userpasswordlostbundle.successful_reset, method: onSuccessfulReset }

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-11-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固