Skip to content

Instantly share code, notes, and snippets.

@RalfAlbert RalfAlbert/file1.php
Created Mar 20, 2012

What would you like to do?
Example 1 for Formatter
require_once 'class-formatter.php';
class Lister extends Formatter
public function get_list( $data = array() ){
$inner = new stdClass();
$values = new stdClass();
foreach( $data as $key => $value ){
$values->key = $key;
$values->item = $value;
$inner->inner .= self::sprintf( '<li>%item%</li>', $values );
return self::sprintf( '<ol>%inner%</ol>', $inner );
$data = array( 'Eins', 'Zwei', 'Drei' );
$list = new Lister();
echo $list->get_list( $data );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.