VCard PHP library
, (*1)
VCard PHP library. Only VCF files., (*2)
Usage
Installation
composer require rogersxd/vcard
This will install the latest version of vcard with Composer, (*3)
Example
``` php
use Rogersxd\VCard\VCard;, (*4)
$vcard = new VCard();, (*5)
$vcard->addPhoto(DIR .'/images/rogerscorrea.jpg');, (*6)
$lastName = 'CorrĂȘa';
$firstName = 'Rogers';
$additional = '';
$prefix = '';
$suffix = '';
$fullName = true;, (*7)
$vcard->addnames(
$lastName,
$firstName,
$additional,
$prefix,
$suffix,
$fullName
);, (*8)
$vcard->addPhone('+5551999999999', 'CELL');, (*9)
$vcard->addPhone('+555133333333', 'HOME');, (*10)
$vcard->addJobtitle('Banking');, (*11)
$vcard->addRole('Developer');, (*12)
$vcard->addEmail('rogersgbc@gmail.com');, (*13)
$vcard->addCompany('XYZ');, (*14)
$vcard->addUrl('http://rogerscorrea.wordpress.com');, (*15)
$vcard->addUrl('https://github.com/rogersxd');, (*16)
$vcard->addNote('CUSTOM-NOTE: TEST VCARD');, (*17)
$vcard->addBirthday('YYYY-MM-DD');, (*18)
$name = '';
$extended = '';
$street = 'Francisco Martins, 123';
$city = 'Porto Alegre';
$region = 'RS';
$zip = '91712-150';
$country = 'BR';
$type = 'HOME';, (*19)
$vcard->addAddress(
$name,
$extended,
$street,
$city,
$region,
$zip,
$country,
$type
);, (*20)
$socialProfile1 = 'https://facebook.com/';
$typeSocialProfile1 = 'facebook';, (*21)
$socialProfile2 = 'https://instagram.com/';
$typeSocialProfile2 = 'instagram';, (*22)
$socialProfile3 = 'https://twitter.com/';
$typeSocialProfile3 = 'twitter';, (*23)
$socialProfile4 = 'https://linkedin.com/';
$typeSocialProfile4 = 'linkedin';, (*24)
$vcard->addSocialProfile(
$socialProfile1,
$typeSocialProfile1
);, (*25)
$vcard->addSocialProfile(
$socialProfile2,
$typeSocialProfile2
);, (*26)
$vcard->addSocialProfile(
$socialProfile3,
$typeSocialProfile3
);, (*27)
$vcard->addSocialProfile(
$socialProfile4,
$typeSocialProfile4
);, (*28)
$vcard->addCustom('X-CUSTOM(CHARSET=UTF-8,ENCODING=QUOTED-PRINTABLE,Custom1)','1');, (*29)
$vcard->setSavePath(DIR. '/vcf/');, (*30)
$vcard->save();, (*31)
```, (*32)
Documentation
The class is well documented inline., (*33)
Contributing
Contributions are welcome and will be fully credited., (*34)
Pull Requests
To add or update code, (*35)
-
Coding Syntax - Please keep the code syntax consistent with the rest of the package.
-
Add unit tests! - Your patch won't be accepted if it doesn't have tests.
-
Document any change in behavior - Make sure the README and any other relevant documentation are kept up-to-date.
-
Consider our release cycle - We try to follow semver. Randomly breaking public APIs is not an option.
-
Create topic branches - Don't ask us to pull from your master branch.
-
One pull request per feature - If you want to do more than one thing, send multiple pull requests.
-
Send coherent history - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please squash them before submitting.
Issues
For bug reporting or code discussions., (*36)
More info on how to work with GitHub on help.github.com., (*37)
Credits
License
The module is licensed under MIT. In short, this license allows you to do everything as long as the copyright statement stays present., (*38)