php-solution/notification-bundle 问题修复 & 功能扩展

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

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

php-solution/notification-bundle

Composer 安装命令:

composer require php-solution/notification-bundle

包简介

Symfony bundle for using notification component with user notify functionality

README 文档

README

This bundle integrates Notification component to Symfony application.

Please, see documentation for Notification component before start development.

Configuration

notification:
    extensions:
        use_for_manager: "notification.extension.context_configurator"
        context_configurator:
            enabled: true
        event_dispatcher:
            enabled: false
    notifier_swiftmailer:
        enabled: true
        default_sender: ~

Installing

  1. Add to your composer.json
    "require": {
        ...
        "php-solution/notification-bundle": "dev-master",
        ...
    }
  1. run:
    composer update php-solution/notification-bundle

Example

Notification Type:

    <?php
    namespace AppBundle\Notification;
    
    use PhpSolution\Notification\Context;
    use PhpSolution\Notification\Extension\ContextConfigure\ConfiguratorInterface;
    use PhpSolution\Notification\Rule\RuleInterface;
    use PhpSolution\Notification\Type\AbstractType;
    use PhpSolution\NotificationBundle\Notifier\SwiftMailer\Rule;
    use Symfony\Component\OptionsResolver\OptionsResolver;
    
    class NotificationType extends AbstractType implements ConfiguratorInterface
    {
        /**
         * Must yield RuleInterface
         *
         * @param Context|null $context
         *
         * @return \Generator|RuleInterface|RuleInterface[]
         */
        public function initialize(?Context $context): \Generator
        {
            yield new Rule($context['recipient_email']);
        }
    
        /**
         * @param OptionsResolver $resolver
         */
        public function configureContext(OptionsResolver $resolver)
        {
            $resolver
                ->setRequired('recipient_email')
                ->setAllowedTypes('recipient_email', 'string');
        }
    }        

On controller:

    $this->get('notification.manager')->notifyType(
        new NotificationType(), 
        new Context(['recipient_email' => 'email@gmail.com'])
    );

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-03-30

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固