承接 locomotivemtl/charcoal-contrib-embed 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

locomotivemtl/charcoal-contrib-embed

Composer 安装命令:

composer require locomotivemtl/charcoal-contrib-embed

包简介

Charcoal service provider for the Embed library.

关键字:

README 文档

README

License Latest Stable Version

A Charcoal service provider for the Embed library.

Installation

The preferred and only supported method is with Composer:

$ composer require locomotivemtl/charcoal-contrib-embed

Dependencies

Required

Service Provider

Services

  • embed/repository is an instance of Charcoal\Embed\EmbedRepository and serves as the primary API for fetching and caching embed data.

Configuration

Including the embed module in the projects's configuration file will register the service provider and the [locomotivemtl/charcoal-admin] route for remotely updating the cached embed information:

{
    "modules": {
       "charcoal/embed/embed": {}
    }
}

Otherwise, the service provider can be included directly:

{
    "service_providers": {
        "charcoal/embed/service-provider/embed": {}
    }
}

The contrib package can be configured from the the project's configuration file (default values for illustration):

{
    "embed_config": {
        "ttl": 3600,
        "format": "array",
        "table": "embed_cache"
    }
}

Usage

The contrib package provides a custom embed model property that upon save will fetch the URL's embed information and store a subset of that data in a custom database table.

{
    "video": {
        "type": "embed",
        "l10n": true,
        "label": "Video",
        "notes": "Absolute URL: <code>https://www.youtube.com/watch?v={video_id}</code>"
    }
}

A URL's embed data can be retrieved using the EmbedRepository:

$this->embedRepository()->embedData('https://youtube.com/{video_id}');

Development

The package can be linted with squizlabs/php_codesniffer and tested with phpunit/phpunit from the following command:

$ composer tests

Coding Style

The charcoal-contrib-embed module follows the Charcoal coding-style:

Credits

License

Charcoal is licensed under the MIT license. See LICENSE for details.

统计信息

  • 总下载量: 1.27k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 8
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 10
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-08-31

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固