Add ActionDateC

This commit is contained in:
Adam Backstrom 2013-07-25 12:25:49 -04:00
parent 2802ad66df
commit d2234c0ad8
2 changed files with 23 additions and 0 deletions

View File

@ -173,6 +173,28 @@ class ActionJsonEncode extends AbstractAction
}
}
class ActionDateC extends AbstractAction
{
public function __construct( $value )
{
parent::__construct( $value );
$this->setContainer( new DivContainer );
$this->setFormatter( new DbugFormatter );
}
public function decode()
{
$results = array();
array_map(function($value) use (&$results) {
$results[$value] = date('c', $value);
}, explode("\n", $this->value));
return $results;
}
}
interface ContainerInterface
{
public function wrap( $contents );

View File

@ -43,6 +43,7 @@ if( 'POST' === $_SERVER['REQUEST_METHOD'] ) {
<option value="Base64Encode" <?php echo selected($action_str, 'Base64Encode'); ?>>base64_encode()</option>
<option value="JsonDecode" <?php echo selected($action_str, 'JsonDecode'); ?>>json_decode()</option>
<option value="JsonEncode" <?php echo selected($action_str, 'JsonEncode'); ?>>json_encode()</option>
<option value="DateC" <?php echo selected($action_str, 'DateC'); ?>>date('c', %s)</option>
<select>
<input type="submit">
</form>