承接 alpixel/phoneformatterbundle 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

alpixel/phoneformatterbundle

Composer 安装命令:

composer require alpixel/phoneformatterbundle

包简介

Provides helper to format phone number easily

README 文档

README

Latest Stable Version

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.

You can call the helper this way

$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.

The format option can be :

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

Twig extension

The helper is callable via a twig extension like this :

"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")

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-10-24

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固