A CakePHP 3.x telephone number formatting plugin.

Installs: 11 392

Dependents: 0

Suggesters: 0

Security: 0

Stars: 8

Watchers: 3

Forks: 1

Open Issues: 0


v2.0.0 2016-09-30 04:45 UTC

This package is not auto-updated.

Last update: 2022-06-25 07:12:29 UTC


Software License Travis Codecov Scrutinizer Packagist

A phone number formatting helper for CakePHP 3.x


The phone number helper is designed to help format phone numbers of all types into tel links or just a prettified format. Please send a pull request if you do not see your phone number format included.


composer require potatopowered/phone-helper

Add the helper to the public helpers variable of the controller you need it on or in the AppController to have it accessible in all controllers.

public $helpers = [
    'Phone' => [
        'className' => 'PhoneHelper.Phone'


To use the phone number formatter you must have the helper loaded in your controller. Once loaded in the controller as shown above you can call the number helper's format($number) function.

// (123) 456-789

// 456-7890

You can also add telephone links in RFC3966 format using the 'link' method

// <a href="tel:+1234567890">123-456-7890</a>

// <a href="tel:+1234567890">Call Us</a>
$this->Phone->link(h('Call Us'), '1234567890');