2017 © Pedro Peláez
 

symfony-bundle secure-display-bundle

NetinfluenceSecureDisplayBundle is a small simple bundle which protect emails and phone numbers behine encryption and JavaScript

image

netinfluence/secure-display-bundle

NetinfluenceSecureDisplayBundle is a small simple bundle which protect emails and phone numbers behine encryption and JavaScript

  • Saturday, October 17, 2015
  • by blaazzze
  • Repository
  • 2 Watchers
  • 3 Stars
  • 796 Installations
  • PHP
  • 1 Dependents
  • 1 Suggesters
  • 0 Forks
  • 0 Open issues
  • 9 Versions
  • 0 % Grown

The README.md

SecureDisplayBundle

NetinfluenceSecureDisplayBundle is a small simple bundle which protect emails, phone numbers and any text you want from spam bot, by using encryption, ajax and JavaScript., (*1)

SensioLabsInsight knpbundles.com Build Status, (*2)

Requirements

Before installing this bundle, you need to have a working installation of FOSJsRoutingBundle., (*3)

Version 1.x is compatible with Symfony 2 (2.3 - 2.8), version 2.x are compatible with Symfony 2.8, 3.x and 4.x
Code is tested on PHP 5.6 and PHP 7.0 to PHP 7.3, (*4)

Installation

Step 1: Composer

First you need to add netinfluence/secure-display-bundle to composer.json:, (*5)

{
   "require": {
        "netinfluence/secure-display-bundle": "dev-master"
    }
}

note: replace dev-master with the last version of this bundle., (*6)

Step 2: AppKernel

Register the bundle into the Symfony AppKernel, (*7)

// app/AppKernel.php

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            ...
            new Netinfluence\SecureDisplayBundle\NetinfluenceSecureDisplayBundle()
        );

        return $bundles;
    }
}

Step 3: Config

Define the configuration of the bundle into the config file, (*8)

# app/config/config.yml
netinfluence_secure_display:
    # Required, key used to encrypt data
    key: "my_super_random_secure_key"
    # Optional, you can customize used template here
    template: 'NetinfluenceSecureDisplayBundle::secure_display.html.twig'

Step 4: Routing

Register the routing of the bundle to be able to perform ajax requests, (*9)

# app/config/routing.yml
netinfluence_secure_display:
    resource: "@NetinfluenceSecureDisplayBundle/Resources/config/routing.yml"
    prefix:   /

Step 5: Assets

Publish the assets to be able to use the javascript file, (*10)

$ php app/console assets:install --symlink web

Add this line in your layout:, (*11)

<script src="{{ asset('bundles/netinfluencesecuredisplay/js/display.js') }}"></script>

Declaration

{{ some.data|secureDisplay(label, action, attributes) }}

parameters - label: optional - type: string - value: text to display if the javascript is not enabled - action: optional - type: string - value: action to append before the link (like "tel:012 345 67" or "mailto:john@doe.com") - attributes: optional - type: array - value: html attributes to add to the text, (*12)

Usage




Here are my personal informations

{# Default usage #}

My name is : {{ contact.name|secureDisplay }}, (*13)

{# Custom label when JavaScript is not enabled #}

You can find me at : {{ contact.address|secureDisplay('this address is protected') }}, (*14)

{# Transform phone number into clicable link #} {# Can be 'tel', 'mailto', whatever you want #}

My phone number is : {{ contact.phoneNumber|secureDisplay(null, 'tel') }}, (*15)

{# Custom html attributes #}

My favorite color is : {{ contact.color|secureDisplay(null, null, { 'style': 'color: red' }) }}, (*16)

Of course, you can mix any of these tree parameters as you want., (*17)

The Versions

17/10 2015

dev-master

9999999-dev

NetinfluenceSecureDisplayBundle is a small simple bundle which protect emails and phone numbers behine encryption and JavaScript

  Sources   Download

MIT

The Requires

 

The Development Requires

email secure phone netinfluence

27/04 2015

1.1.6

1.1.6.0

NetinfluenceSecureDisplayBundle is a small simple bundle which protect emails and phone numbers behine encryption and JavaScript

  Sources   Download

MIT

The Requires

 

The Development Requires

email secure phone netinfluence

27/04 2015

1.1.5

1.1.5.0

NetinfluenceSecureDisplayBundle is a small simple bundle which protect emails and phone numbers behine encryption and JavaScript

  Sources   Download

MIT

The Requires

 

The Development Requires

email secure phone netinfluence

27/04 2015

1.1.4

1.1.4.0

NetinfluenceSecureDisplayBundle is a small simple bundle which protect emails and phone numbers behine encryption and JavaScript

  Sources   Download

MIT

The Requires

 

email secure phone netinfluence

22/04 2015

1.1.3

1.1.3.0

NetinfluenceSecureDisplayBundle is a small simple bundle which protect emails and phone numbers behine encryption and JavaScript

  Sources   Download

MIT

The Requires

 

email secure phone netinfluence

21/04 2015

1.1.2

1.1.2.0

NetinfluenceSecureDisplayBundle is a small simple bundle which protect emails and phone numbers behine encryption and JavaScript

  Sources   Download

MIT

The Requires

 

email secure phone netinfluence

16/04 2015

1.1.1

1.1.1.0

NetinfluenceSecureDisplayBundle is a small simple bundle which protect emails and phone numbers behine encryption and JavaScript

  Sources   Download

MIT

The Requires

 

email secure phone netinfluence

15/04 2015

1.1.0

1.1.0.0

NetinfluenceSecureDisplayBundle is a small simple bundle which protect emails and phone numbers behine encryption and JavaScript

  Sources   Download

MIT

The Requires

 

email secure phone netinfluence

14/04 2015

1.0.0

1.0.0.0

NetinfluenceSecureDisplayBundle is a small simple bundle which protect emails and phone numbers behine encryption and JavaScript

  Sources   Download

MIT

The Requires

 

email secure phone netinfluence