2017 © Pedro Peláez
 

library markup-protocol

Barnebys Markup Protocol enhances information associated with an auction item on a webpage through key-value pairs included as <meta> elements in your HTML.

image

barnebys/markup-protocol

Barnebys Markup Protocol enhances information associated with an auction item on a webpage through key-value pairs included as <meta> elements in your HTML.

  • Friday, May 12, 2017
  • by barnebys
  • Repository
  • 2 Watchers
  • 3 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Latest Stable Version Build Status Coverage Status, (*1)

Barnebys Markup Protocol

This library is a tool to generate Barnebys Markup Tags with PHP., (*2)

Requirements

PHP >= 5.6, (*3)

Installation

The recommended way is to use composer, (*4)

composer require barnebys/markup-protocol, (*5)

If your project does not support composer, you can either clone the project on GitHub or download the package from here. You will then have to manually add the library to your project., (*6)

Examples

Auction Item

Code, (*7)

use Barnebys\Protocol\Object;
use Barnebys\Protocol\Auction;
use Barnebys\Protocol\Price;

// Creates a new object
$object = new Object();
$object ->setTitle('Rolex 1956')
        ->setDescription('A fine watch in mint condition.')
        ->setURL('http://test.com/lot/1234')
        ->setImage('http://test.com/lot/1234.jpg')
        ->setCategory('watches')
        ->setPrice(new Price(150, 200, 'EUR'))
        ->setAuction(new Auction('2017-04-22T15:03:01.012345Z', '2017-08-01T15:03:01.012345Z'));

// Prints the meta tags
echo $object;

Outputs, (*8)

<meta property="barnebys:title" content="Rolex 1956">
<meta property="barnebys:description" content="A fine watch in mint condition.">
<meta property="barnebys:url" content="http://test.com/lot/1234">
<meta property="barnebys:image" content="http://test.com/lot/1234.jpg">
<meta property="barnebys:category" content="watches">
<meta property="barnebys:price:amount" content="150">
<meta property="barnebys:price:bid" content="200">
<meta property="barnebys:price:currency" content="EUR">
<meta property="barnebys:auction:start" content="2017-04-22T15:03:01+00:00">
<meta property="barnebys:auction:end" content="2017-08-01T15:03:01+00:00">

Fixed Price Item

Code, (*9)

// Creates a new object
$object = new Object();
$object ->setTitle('Rolex 1956')
        ->setDescription('A fine watch in mint condition.')
        ->setURL('http://test.com/lot/1234')
        ->setImage('http://test.com/lot/1234.jpg')
        ->setCategory('watches')
        ->setSold(false)
        ->setPrice(new Price(150, null, 'EUR'));

// Prints the meta tags
echo $object;

Outputs, (*10)

<meta property="barnebys:title" content="Rolex 1956">
<meta property="barnebys:description" content="A fine watch in mint condition.">
<meta property="barnebys:url" content="http://test.com/lot/1234">
<meta property="barnebys:image" content="http://test.com/lot/1234.jpg">
<meta property="barnebys:category" content="watches">
<meta property="barnebys:price:amount" content="150">
<meta property="barnebys:price:currency" content="EUR">
<meta property="barnebys:sold" content="0">

The Versions

12/05 2017

dev-master

9999999-dev

Barnebys Markup Protocol enhances information associated with an auction item on a webpage through key-value pairs included as <meta> elements in your HTML.

  Sources   Download

Apache 2.0

The Development Requires

by Johan Johansson

markup auctions barnebys