2017 © Pedro Peláez
 

library laravel-formatter

A formatting library that converts data output between XML, CSV, JSON, TXT, YAML and a few others. And supports @attributes in XML

image

daniel-furmanov/laravel-formatter

A formatting library that converts data output between XML, CSV, JSON, TXT, YAML and a few others. And supports @attributes in XML

  • Wednesday, August 30, 2017
  • by DanielFurmanov
  • Repository
  • 1 Watchers
  • 3 Stars
  • 3,897 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 74 Forks
  • 0 Open issues
  • 5 Versions
  • 17 % Grown

The README.md

Attention!

This fork was made to support encoding and '@attributes' and '@value' in xml, so that nodes (xml tags) could support attributes and native string nodes. Any credits should go to the original author of this bundle. Use at your own risk!, (*1)

Formatter Bundle

Build Status, (*2)

A formatter package that will help you to easily convert between various formats such as XML, JSON, CSV, etc..., (*3)

Goals

The goals of this library are to allow the transfomation of data formats from one type to another. See Parsers and Formats to see supported input / output formats., (*4)

Installation

Through command line:, (*5)

composer require daniel-furmanov/laravel-formatter

Through composer.json:, (*6)

{
  "require": {
    "daniel-furmanov/laravel-formatter": "dev-master",
  }
}

Parsers

All of the following are supported formats that the formatter can read from. * Array * CSV * JSON * XML * YAML, (*7)

Formats

All of the following are formats that are supported for output. * Array * CSV * JSON * XML * YAML, (*8)

General Usage

Including The Formatter, (*9)

use DanielFurmanov\Formatter\Formatter;

Supported Types, (*10)

Formatter::JSON; //json
Formatter::CSV;  //csv
Formatter::XML;  //xml
Formatter::ARR;  //array
Formatter::YAML; //yaml

Making Your First Formatter(s), (*11)

$formatter = Formatter::make($jsonString, Formatter::JSON);
$formatter = Formatter::make($yamlString, Formatter::YAML);
$formatter = Formatter::make($array, Formatter::ARR);
...

Outputting From Your Formatter, (*12)

$csv   = $formatter->toCsv();
$json  = $formatter->toJson();
$xml   = $formatter->toXml();
$array = $formatter->toArray();
$yaml  = $formatter->toYaml();

Deprecated Functionality

The following have been deprecated from the library, however you can easily continue using them in your application, (*13)

Serialized Array, (*14)

$serialized = serialize($formatter->toArray());

PHP Export, (*15)

$export = var_export($formatter->toArray());

The Versions

30/08 2017

dev-master

9999999-dev https://github.com/DanielFurmanov/laravel-formatter

A formatting library that converts data output between XML, CSV, JSON, TXT, YAML and a few others. And supports @attributes in XML

  Sources   Download

MIT

The Requires

 

laravel csv xml formatter yaml data convert

10/04 2015

dev-feature/add-php-7-and-hhvm-support

dev-feature/add-php-7-and-hhvm-support http://github.com/SoapBox/laravel-formatter

A formatting library that converts data output between XML, CSV, JSON, TXT, YAML and a few others.

  Sources   Download

MIT

The Requires

 

laravel csv xml formatter yaml data convert

20/10 2014

2.0

2.0.0.0 http://github.com/SoapBox/laravel-formatter

A formatting library that converts data output between XML, CSV, JSON, TXT, YAML and a few others.

  Sources   Download

MIT

The Requires

 

laravel csv xml formatter yaml data convert

19/08 2014

1.4

1.4.0.0 http://github.com/SoapBox/laravel-formatter

A Laravel 4 formatting library that converts data output between XML, CSV, JSON, TXT, YAML and a few others.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel csv xml formatter yaml data convert

26/03 2014

1.1

1.1.0.0 http://github.com/SoapBox/laravel-formatter

A Laravel 4 formatting library that converts data output between XML, CSV, JSON, TXT, YAML and a few others.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel csv xml formatter yaml data convert