virmyt/symfony-user-referer-bundle 问题修复 & 功能扩展

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

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

virmyt/symfony-user-referer-bundle

最新稳定版本:1.0.0

Composer 安装命令:

composer require virmyt/symfony-user-referer-bundle

包简介

Symfony 2 User referer bundle

README 文档

README

This package contains a bundle to easily save information about referal users that came to your web-site All users that registrate on web-site, and come to it with containing GET argument "ref" (http://site.com/downloads?ref=hfkjgv), will be saved with additional information: ref, ip, referer, date

Installation

Add SymfonyUserReferer in your composer.json:

{
    "require": {
        "virmyt/symfony-user-referer-bundle": "dev-master"
    }
}

Add in AppKernel.php:

       $bundles = array(
            ...
            new \Virmyt\UserRefererBundle\VirmytUserRefererBundle(),
        );

Configure entity mapping to your User Entity:

doctrine:
    ...
    orm:
        ...
        resolve_target_entities:
            Virmyt\UserRefererBundle\Model\ReferrerInterface: App\MainBundle\Entity\User

where App\MainBundle\Entity\User - should be your User Entity.

And it MUST implement Virmyt\UserRefererBundle\Model\ReferrerInterface

<?php
use Virmyt\UserRefererBundle\Model\ReferrerInterface;
class User implements ReferrerInterface {
    public function getRef()
    {
        return $this->ref; // For examle
    }
...

Update DB schema:

php app/console doctrine:schema:update --dump-sql -v --force

Usage:

All Referal data about user will be saved in single table users_referral that have relation to your UserEntity.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-12-20