Add ActionDateC
This commit is contained in:
parent
2802ad66df
commit
d2234c0ad8
22
classes.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 );
|
||||
|
@ -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…
Reference in New Issue
Block a user