SilverStripe Link

Phone extends ViewableData
in package

Phone

Table of Contents

Properties

$fromCountry  : string
The country the user is dialing from.
$instance  : PhoneNumber
$library  : PhoneNumberUtil
$phoneNumberFormat  : int
$default_country  : mixed

Methods

__construct()  : mixed
E164()  : Phone
Format the phone number in E164 format
forTemplate()  : HTML
From()  : Phone
Set the country the user is dialing from.
International()  : Phone
Format the phone number in international format.
LeadingZero()  : Phone
Sets whether this phone number uses a leading zero.
National()  : Phone
Format the phone number in national format.
Render()  : HTML
RFC3966()  : Phone
Format the phone number in RFC3966 format.
To()  : Phone
Set the country to which the phone number belongs to.

Properties

$fromCountry

The country the user is dialing from.

protected string $fromCountry

$instance

protected PhoneNumber $instance

$library

protected PhoneNumberUtil $library

$phoneNumberFormat

protected int $phoneNumberFormat = \libphonenumber\PhoneNumberFormat::E164

$default_country

private static mixed $default_country = 'NZ'

Methods

__construct()

public __construct(mixed $phone) : mixed
Parameters
$phone : mixed

E164()

Format the phone number in E164 format

public E164() : Phone
Return values
Phone

forTemplate()

public forTemplate() : HTML
Return values
HTML

From()

Set the country the user is dialing from.

public From(string $country) : Phone
Parameters
$country : string
Return values
Phone

International()

Format the phone number in international format.

public International() : Phone
Return values
Phone

LeadingZero()

Sets whether this phone number uses a leading zero.

public LeadingZero([bool $value = true ]) : Phone
Parameters
$value : bool = true

True to use italian leading zero, false otherwise.

Return values
Phone

National()

Format the phone number in national format.

public National() : Phone
Return values
Phone

Render()

public Render() : HTML
Return values
HTML

RFC3966()

Format the phone number in RFC3966 format.

public RFC3966() : Phone
Return values
Phone

To()

Set the country to which the phone number belongs to.

public To(string $country) : Phone
Parameters
$country : string
Return values
Phone

        
On this page

Search results