2017 © Pedro Peláez
 

library html-wxml-converter

A PHP library that can convert html into wxml and back.

image

yyxx9988/html-wxml-converter

A PHP library that can convert html into wxml and back.

  • Monday, March 13, 2017
  • by yyxx9988
  • Repository
  • 1 Watchers
  • 5 Stars
  • 12 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Html-Wxml Converter

A PHP library that can convert html into wxml and back., (*1)

Requirement

  • PHP >= 5.4

Installation

$ composer require "yyxx9988/html-wxml-converter"

Usage

use \yyxx9988\mlconverter\Converter;

$converter = new Converter();

$converter->setHtml('


...

, (*2)

'); echo $converter->convert(); // result <view data-htmltag="div"> <view data-htmltag="a">...</view> <view data-htmltag="p"><image src="..."></image></view> </view>

Customize

  • Default supported tags
[
    'p' => 'view',
    'h1' => 'view',
    'h2' => 'view',
    'h3' => 'view',
    'h4' => 'view',
    'h5' => 'view',
    'h6' => 'view',
    'ul' => 'view',
    'ol' => 'view',
    'li' => 'view',
    'div' => 'view',
    'nav' => 'view',
    'pre' => 'view',
    'code' => 'view',
    'menu' => 'view',
    'aside' => 'view',
    'header' => 'view',
    'footer' => 'view',
    'legend' => 'view',
    'section' => 'view',
    'article' => 'view',
    'caption' => 'view',
    'details' => 'view',
    'summary' => 'view',
    'menuitem' => 'view',
    'blockquote' => 'view',

    'i' => 'text',
    'b' => 'text',
    's' => 'text',
    'u' => 'text',
    'big' => 'text',
    'del' => 'text',
    'sub' => 'text',
    'sup' => 'text',
    'ins' => 'text',
    'font' => 'text',
    'mark' => 'text',
    'time' => 'text',
    'span' => 'text',
    'center' => 'text',
    'strong' => 'text',
    'strike' => 'text',
];
  • Customize special tags
$converter = new Converter();

// add a tag
$converter->addHtmlTags('xxx', 'view');

// change a tag
$converter->setHtmlTags('li', 'text');

// remove a tag
$converter->removeHtmlTags('article');

echo $converter->convert();

License

MIT, (*3)

The Versions

13/03 2017

dev-master

9999999-dev

A PHP library that can convert html into wxml and back.

  Sources   Download

MIT

The Development Requires

by Avatar yyxx9988

html converter wxml

13/03 2017

v1.0.0

1.0.0.0

A PHP library that can convert html into wxml and back.

  Sources   Download

MIT

The Development Requires

by Avatar yyxx9988

html converter wxml

12/03 2017

v1.0.0-beta

1.0.0.0-beta

A PHP library that can convert html into wxml and back.

  Sources   Download

MIT

The Development Requires

by Avatar yyxx9988

html converter wxml