定制 sclinternet/scl-contact 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

sclinternet/scl-contact

Composer 安装命令:

composer require sclinternet/scl-contact

包简介

A useful set of classes and interfaces for storing contact information

README 文档

README

Build Status Coverage Status

This module's main purpose is to provide a set of common interfaces for a persons contact details. It includes interfaces for

  • Contact Objects : SclContact\ContactInterface (aggregates all other interfaces)
  • A persons name : SclContact\PersonNameInterface
  • Phone numbers : SclContact\PhoneNumberInterface
  • Email address : SclContact\EmailInterface
  • Postal address : SclContact\AddressInterface
  • Postcode : SclContact\PostcodeInterface
  • Country : SclContact\CountryInterface

This module also contains a basic implementation of each interface which can be used or extend.

Limitations

The names of the address properties are based on addresses in the United Kingdom. It will work fine for other countries but it has methods like getCounty() where people from the USA might expect getState().

The contact interface provides for 1 phone number and 1 fax number. A more flexible approach might be to have a flexible number of phone numbers with a type (mobile, fax, home, work, etc).

There are no social network fields, it might make sense to add these in the no so distant future.

Installation

Installation is easy via composer, simple run:

php composer.phar require sclinternet/scl-contact:dev-master

Then add SclContact to your ZF2 application's modules config.

Fieldsets

2 fieldsets are provided, these are:

  • SclContact\Form\Fieldset\Contact
  • SclContact\Form\Fieldset\Address

To use these it is recommended that you use Zend Framework 2.2's FormElementManager to build your forms.

Hydrators

There are also 2 Hydrators

  • SclContact\Hydrator\ContactHydrator
  • SclContact\Hydrator\AddressHydrator

Again to use these it is recommended that you used Zend Framework 2.2's HydratorManager.

InputFilters

Not yet implementated. Will be done by 0.1 release.

CountryManager

Country objects are assigned to Address objects via a CountryMananger. There is a default SclContact\Country\CountryManager provided which simply returns country objects with with the provided 2 digit country code. However you can implement your own country manager froom SclContact\Country\CountryManagerInterface if you wish to do things like connect up address records with a country table in your database.

Once you have created your own implementation of SclContact\Country\CountryManagerInterface simply specify it in your config like so to use it:

return array(
    'scl_contact' => array(
        'country_manager' => 'MyApplication\MyCountryManager',
    ),
);

Contributing & Using

Feel free to fork or make feature requests.

统计信息

  • 总下载量: 1.5k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 6
  • 点击次数: 1
  • 依赖项目数: 4
  • 推荐数: 0

GitHub 信息

  • Stars: 6
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-02-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固