Browse Source

Add ActionDateC

master
Adam Backstrom 8 years ago
parent
commit
d2234c0ad8
  1. 22
      classes.php
  2. 1
      index.php

22
classes.php

@ -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 );

1
index.php

@ -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>

Loading…
Cancel
Save