Yamato DaiwaFrontend (2.0.0-beta.0)

buildPhoneNumberLinkHrefAttributeValue

(
):string

Generates the value of the HTML attribute href for the a tag, so that once the final link has been clicked or tapped, the telephony software will open, suggesting to call the specified phone number passed as a single parameter. On smartphones, such software is readily available; on other types of devices, users may be prompted to select telephony software such as Skype, People, etc., however, it's likely that charges may apply for calling the phone number.

This function appends tel: to the specified string value, expected to be a valid phone number. If your code editor or Integrated Development Environment (IDE) lacks template autocompletion functionality, this function may be less convenient. Without autocompletion, you may need to either memorize "tel:" or the function name buildPhoneNumberLinkHrefAttributeValue, or refer to the reference guide each time (though "tel:" consists of just three alphabetic letters, it might be forgotten amidst a large volume of other information).

If autocompletion by template functionality is present, starting to input "buildP..." should trigger a popup hint. The subsequent actions depend on how autocompletion is implemented in the code editor or IDE. In the case of Live Templates from the official YDF plugin for IntelliJ IDEA family IDEs , the automatic insertion of the value, previously copied to the clipboard, into the position of the single parameter is executed. Thus, entering the href attribute using the buildPhoneNumberLinkHrefAttributeValue function could be completed by 3-4 key presses, depending on the number of other autocompletions suggested:

Efficiently calling 'buildPhoneNumberLinkHrefAttributeValue' in the Yamato Daiwa Frontend (YDF) library using 'Live Templates functionality' in IntelliJ IDEA family Integrated Development Environments.