2017 © Pedro Peláez
 

symfony-bundle phoneformatterbundle

Provides helper to format phone number easily

image

alpixel/phoneformatterbundle

Provides helper to format phone number easily

  • Monday, October 24, 2016
  • by gouaille
  • Repository
  • 2 Watchers
  • 0 Stars
  • 11 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

AlpixelPhoneFormatterBundle

Latest Stable Version, (*1)

Installation

  • Install the package
composer require 'alpixel/phoneformatterbundle'
  • Update AppKernel.php

<?php // app/AppKernel.php // ... class AppKernel extends Kernel { public function registerBundles() { $bundles = array( // ... new Alpixel\Bundle\PhoneFormatterBundle\AlpixelPhoneFormatterBundle(), ); // ... } // ... }

Utilisation

Helper

The only helper actually available give you the possibility to reformat and clean a phone number following a pattern., (*2)

You can call the helper this way, (*3)

$number = $this->get('alpixel.helper.phone_formatter')->format($currentNumber, PhoneNumberFormat::NATIONAL, 'DE');

The example above will try to output a national german number from the input you gave., (*4)

The format option can be :, (*5)

AlpixelPhoneNumberFormat::INTERNATIONAL // example "+41 44 668 18 00"
AlpixelPhoneNumberFormat::NATIONAL // example : "044 668 18 00"
AlpixelPhoneNumberFormat::E164 // example : "+41446681800"
AlpixelPhoneNumberFormat::AUTO // Will try to make the best guess from your current locale

The third argument is expecting a two letter country code as FR or DE, (*6)

Twig extension

The helper is callable via a twig extension like this :, (*7)

"03 03 03 03 03"|phone_format("INTERNATIONAL", "FR")
"03 03 03 03 03"|phone_format("NATIONAL")
"03 03 03 03 03"|phone_format("AUTO", "CH")

The Versions

24/10 2016

dev-master

9999999-dev https://www.alpixel.fr

Provides helper to format phone number easily

  Sources   Download

MIT

The Requires

 

by ALPIXEL

symfony2 bundle symfony alpixel twig extension formatting phone number

24/10 2016

v1.0

1.0.0.0 https://www.alpixel.fr

Provides helper to format phone number easily

  Sources   Download

MIT

The Requires

 

by ALPIXEL

symfony2 bundle symfony alpixel twig extension formatting phone number