Skip to content

Helper classes to build responsive HTML e-mails with the Ink framework.

Notifications You must be signed in to change notification settings

cschoenfeld/InkHelpers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

InkHelpers PHP classes.

Ink is a terrific framework for building responsive e-mails, 
but it can be difficult to scan the HTML and figure out where you are. 
Using PHP classes to build your rows and columns makes the code a little more readable, 
or at least that's the intention here.

The Ink framework, by ZURB, Inc., can be found here: 
http://zurb.com/ink/

Example usage for the helper classes, showing some of the functionality:

	$row = new Row();
	$row->setClass('myRow anotherClass');
	$col1 = new Columns(8, 'left');
	$col2 = new Columns(4, 'both');
	$col1->setContent("<p>Content of my main column.</p>\n");
	$col2->setContent("<p>Content of my sidebar.</p>");
	$col1->setClass('mainColumn');
	$col1->setWrapperClass('mainColumnWrapper');
	$col2->setClass('sidebar');
	$col2->setWrapperClass('sidebarWrapper');
	$row1->addcol($col1);
	$row1->addcol($col2);
	echo $row1->render();	
	
To use the bulleted list builder: 

	// Create the individual bullets
	$li1 = new Bullet("First bullet.");
	$li2 = new Bullet("Second bullet.");
	$bulletsArr = array($li1, $li2);

	// Wrap the bullets in a "list" object.
	$ul = new BulletList($bulletsArr);
	// Optionally, use a custom "dot" for each list item, instead of a &bull; character.
	$ul->setDot('<img src="http://mysite.org/images/mybullet.png" alt="&bull;">');

	// Render the HTML (into a column of the layout).
	$myColumn->appendContent($ul->render());


@author Charles Schoenfeld, Adams & Knight

About

Helper classes to build responsive HTML e-mails with the Ink framework.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages