定制 gwsn/prismic 二次开发

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

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

gwsn/prismic

Composer 安装命令:

composer require gwsn/prismic

包简介

Cache Wrapper

关键字:

README 文档

README

Installation

Require this package

composer require gwsn/prismic

Frameworks specific packages

  1. Lumen/Laravel composer require gwsn/lumen-transformer
  2. Symfony composer require gwsn/symfony-transformer

Simple example

Include the Transformer class:

use Gwsn\Prismic\Transformer;

In this use case we work only with arrays.

$source = [
    [
        'id'   => '1',
        'name' => 'Test 1',
        'type' => 'text',
        'text' => 'Some text written by Cicero that's used to fill spaces on.'
    ],
    [
        'id'   => '2',
        'name' => 'Test 2',
        'type' => 'short-text',
        'text' => 'The reason why it is difficult to understand is to draw attention away from the words on a page and to focus it on the design instead.'
    ],
    [
        'id'   => '3',
        'name' => 'Test 3',
        'type' => 'text',
        'text' => 'It's also useful for filling spaces where text should be because its words are about the same length as normal English writing.'
    ],
];

$mapping = [
    'guid' => 'id',
    'slug' => 'name',
    'type' => 'type',
    'text' => 'text',
];

$target = Transformer::run($source, Transformer::BuildMapping($mapping));
 
var_dump(json_encode($target)); 
output:
 
 [
     {
         guid: "1",
         slug: "Test Company mapper 1",
         type: "company",
         text: "asdasdfafa afad afads aadssafdf astext"
     },
     {
         guid: "2",
         slug: "Test Company mapper 2",
         type: "blog",
         text: "asdasdfafa afad afads aadssafdf astext"
     },
     {
         guid: "3",
         slug: "Test Company mapper 3",
         type: "company",
         text: "asdasdfafa afad afads aadssafdf astext"
     }
 ]

For the more advanced documentation about the usage you can find it here documentation

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-04-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固