Adding the parameters to our plugin

Our plugin works well, but what if the phone number format in your country is not 1234-5678? For example, Germany uses the format 123-45678. Wouldn't it be better if we had a parameter where we could set the phone number format? As this is a simple plugin, we are not going to worry about area code prefix or numbers in more complex formats such as 123-456-7890; we are concentrating on numbers that consist of two groups of digits.

We are going to add two parameters to our plugin (also known as options), one that sets the number of digits in the first group, and one that sets the number of digits in the second group.

So open up your clicktocall.xml file, and add in the highlighted code shown as follows (everything ...

Get Learning Joomla! 3 Extension Development - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.