A modest collection of PHP libraries used at SparkFun.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

46 lines
756 B

<?php
namespace SparkLib;
use \SparkLib\Renderable;
/**
* Sparkdown macro base class.
*
*/
class SparkdownMacro implements Renderable {
protected $_input;
protected $_context = [];
public function __construct ($input)
{
$this->_input = $input;
}
/**
* Takes things that should be available when the macro is rendered,
* for passing into templates or whatever.
*
* @return SparkdownMacro
*/
public function setContext (array $context)
{
$this->_context = $context;
return $this;
}
/**
* Get the current context array.
*
* @return array
*/
public function getContext ()
{
return $this->_context;
}
public function render ()
{
return '<p>' . $this->_input . '</p>';
}
}