PHP Implementation of ZURB's Foundation for Email parser (Inky)

Maintainers

👁 m.schneider

Package info

github.com/maikschneider/inky

pkg:composer/maikschneider/inky

Statistics

Installs: 4 833

Dependents: 1

Suggesters: 0

Stars: 0

1.3.6.3 2018-12-01 11:12 UTC

Requires

Requires (Dev)

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT c55fd0dec09b2abd887d6926065be4c781631b3a

  • Maik Schneider <schneider.maik.woop@me.com>

This package is auto-updated.

Last update: 2026-06-29 01:41:28 UTC


README

Issue reports and pull requests will not be attended.

Inky

A PHP Implementation of ZURB's Foundation for Email parser (Inky).

Installation

You can install this bundle using composer

composer require maikschneider/inky

or add the package to your composer.json file directly.

Usage and Examples

Basic Usage.

<?php
use Hampe\Inky\Inky;

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

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

Add Tag-Alias

<?php
use Hampe\Inky\Inky;

$inky = new Inky();
$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 Hampe\Inky\Component\ComponentFactoryInterface;
use Hampe\Inky\Inky;
use PHPHtmlParser\Dom\HtmlNode;

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

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

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

License

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