Sunnysideup\PhoneField\Model\Fieldtypes\PhoneField
you can now use the following in your silverstripe templates $MyPhoneField.TelLink which then removes the first 0 adds country code at the end and adds + and country code.
e.g
09 5556789
becomes
tel:+649555789
if you would like a different country code then use:
$MyPhoneField.TelLink(55)
Synopsis
class PhoneField
extends DBVarchar
{
- // members
- private static string $default_country_code = '64';
- private static array $casting = ;
- // methods
- public void IntlFormat()
- public void TelLinkWithZero()
- public void TelLink()
- public void TellLink()
- public void CallToLink()
- protected void literalLeftTrim()
- protected void getProperPhoneNumber()
Hierarchy
Extends
- SilverStripe\ORM\FieldType\DBVarchar
Members
private
- $casting
- $default_country_code
Methods
protected
- getProperPhoneNumber()
- literalLeftTrim() — removes a string at the start of a string, if present...
public
- CallToLink()
- IntlFormat()
- TelLink() — https://stackoverflow.com/questions/1164004/how-to-mark-up-phone-numbers this is the better of the two.
- TelLinkWithZero() — https://stackoverflow.com/questions/1164004/how-to-mark-up-phone-numbers this is the better of the two.
- TellLink() — https://stackoverflow.com/questions/1164004/how-to-mark-up-phone-numbers this is the better of the two.