承接 frogbob/inky-php 相关项目开发

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

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

frogbob/inky-php

最新稳定版本:0.0.2

Composer 安装命令:

composer require frogbob/inky-php

包简介

PHP Implementation of ZURB's Foundation for Email parser - Based on thampe/inky

README 文档

README

InkyPHP

PHP Implementation of ZURB's Foundation for Email parser - Based on thampe/inky

This package compiles ZURB's template-language 'Inky' to it's html version to build responsive email-templates.

It's based on thampe/inky which unfortunately is abandoned.

Docs

Installation

Install package

Add the package in your composer.json by executing the command.

composer require frogbob/inky-php

Usage and Examples

Basic Usage.

<?php
use Frogbob\InkyPHP\InkyPHP;

$gridColumns = 12; //optional, default is 12
$additionalComponentFactories = []; //optional
$inky = new InkyPHP($gridColumns, $additionalComponentFactories);

$inky->releaseTheKraken('html...');

Add Tag-Alias

<?php
use Frogbob\InkyPHP\InkyPHP;

$inky = new InkyPHP();
$inky->addAlias('test', 'callout')

$inky->releaseTheKraken('<test>123</test>'); //equal to "<callout>123</callout>"

Add your own component factory

Add your own component factory, to convert custom HTML-Tags.

<?php

use Frogbob\InkyPHP\Component\ComponentFactoryInterface;
use Frogbob\InkyPHP\InkyPHP;
use PHPHtmlParser\Dom\HtmlNode;

class TestComponentFactory implements ComponentFactoryInterface
{
    public function getName()
    {
        return 'test' // name of the html tag.
    }

    public function parse(HtmlNode $element, InkyPHP $inkyInstance)
    {
        // ...
    }
}

$inky = new InkyPHP();
$inky->addComponentFactory(new TestComponentFactory());
$inky->releaseTheKraken('<test></test>');

License

See the LICENSE file for license info (it's the MIT license).

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-07-23