chteuchteu/corporate-vcards-bundle
Composer 安装命令:
composer require chteuchteu/corporate-vcards-bundle
包简介
Easily create professional looking vcards
README 文档
README
This Bundle allows you to easily create simple & professional looking vcards:
Features
- Produces a set of webpages for each defined profile: (with a customizable prefix)
- /vcard/jppernaut
- /vcard/cchazal
- /vcard/pparvor
- On click, shows a QR Code containing all the profile information in the vcard vcf format
- Easily download the .vcf file to be opened in any contacts management tool
- Easily share the page by sending it as e-mail to a client, friend, relative, ...
Let's get started
To install this bundle inside your existent symfony2 project, follow these instructions:
-
Require this project
composer require chteuchteu/corporate-vcards-bundle
-
Register this bundle in symfony's kernel:
// app/AppKernel.php public function registerBundles() { $bundles = array( // ... new Chteuchteu\CorporateVCardsBundle\CorporateVCardsBundle(), ); }
-
Configure routing:
# app/config/routing.yml CorporateVCardsBundle: resource: "@CorporateVCardsBundle/Resources/config/routing.yml" prefix: /vcard/
-
Configure the bundle (see Defining profiles)
-
Install assets:
php bin/console asset:install
Defining profiles
We're now ready to configure this bundle. The config node sets general configuration, while default and profiles
defines profiles-related information.
First, define define some - or none - default values using the default node. Then, create one or several profiles inside
the profiles node. A valid profile tree would look like this:
bdumaurier: firstName: Bedelia lastName: Du Maurier company: Hannibal & Associates jobTitle: CEO email: bdumaurier@hannibal.com phone: mobile: +33 6 12 34 56 78 work: +33 3 12 34 56 78 address: street: 3706 Merry Cider Round city: Silverado region: California zip: 92676 country: US photo: bundles/app/img/vcards-people/bdumaurier.jpg url: http://www.my-website.com
All these three nodes produces the following configuration tree view:
# app/config/config.yml corporate_v_cards: config: # BUNDLE CONFIGURATION mails_service: @app.mails # Set to null to disable mails favicons: enabled: true real_favicon_generator_api_key: null dir: "@AppBundle/Resources/public/img/vcards-favicons/" backgrounds: - bundles/app/img/vcards-backgrounds/1.jpg - bundles/app/img/vcards-backgrounds/2.jpg - bundles/app/img/vcards-backgrounds/3.jpg - bundles/app/img/vcards-backgrounds/4.jpg - bundles/app/img/vcards-backgrounds/5.jpg default: # DEFAULT PROFILE INFORMATION company: My Company phone: work: +33 3 45 67 89 10 url: http://my_website.com profiles: # PROFILES jdoe: firstName: John lastName: Doe photo: bundles/app/img/vcards-people/jdoe.jpg
Warning: all URIs must be formatted as above (
@AppBundle/Resources/public/file.extvsbundles/app/file.extformat, trailing and leading slashes)
Mails
If enabled, a form will be shown on each vcard's page, allowing one to send the current vcard to an e-mail address.
You must handle sending the mail in your own bundle, by implementing the MailsServiceInterface's sendVcard function. It received three arguments:
$toMail: form-submitted e-mail address$profile: person's information:[ 'firstName' => 'John', 'lastName' => 'Doe', /* ... */ ]$person: person's name as defined in your config.yml file:jdoe
Favicons
Each profile can have custom favicons generated from its profile picture, using RealFaviconGenerator's API. In order to use this feature, you must generate your own Non-interactive API key here.
It is recommended to configure config.favicons.dir to be a directory in your own bundle, so you can add generated assets to source control.
Once run, the cvc:generate-favicons command will loop over each one of the configured profiles, and call RealFaviconGenerator's API
if the current profile has a photo and hasn't any generated favicons yet.
Note 1: you can force regenerating favicons for a profile by deleting its dir content
Note 2: you must execute this command if you add new profiles, change a photo, or rename a profile key.
Email protection
In order to protect profiles e-mail addresses against spammer robots, we "encrypt" them using ROT13 substitution cipher. Those are then decoded client-side using a simple javascript script. This technique is not meant to be perfect nor secure, but to avoid displaying clear e-mail addresses in the vcards HTML source.
Contribute
All contributions are welcomed! Please create your pull-requests against the master branch.
chteuchteu/corporate-vcards-bundle 适用场景与选型建议
chteuchteu/corporate-vcards-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1 次下载、GitHub Stars 达 0, 最近一次更新时间为 2016 年 10 月 07 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「qrcode」 「vCard」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 chteuchteu/corporate-vcards-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 chteuchteu/corporate-vcards-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 chteuchteu/corporate-vcards-bundle 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Based in http://phpqrcode.sourceforge.net/
A clean, modern, and easy-to-use QR code generator for Laravel
Symfony 4, 5, 6 ,7 Barcode Generator Bundle with Twig function extension
This VCard PHP class can generate a vCard with some data. When using an iOS device it will export as a .ics file because iOS devices don't support the default .vcf files.
📇 PHP library for address book contacts (make vCards for contacts)
Generates QR Codes
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-10-07
