Add parse_str() action

This commit is contained in:
Adam Backstrom 2014-03-13 12:10:33 -04:00
parent 4f7f6ff702
commit 03aa7169de
2 changed files with 17 additions and 0 deletions

View File

@ -202,6 +202,22 @@ class ActionDateC extends AbstractAction
}
}
class ActionParseStr extends AbstractAction
{
public function setUp()
{
$this->setContainer( new DivContainer );
$this->setFormatter( new DbugFormatter );
}
public function decode()
{
parse_str($this->value, $results);
return $results;
}
}
interface ContainerInterface
{
public function wrap( $contents );

View File

@ -46,6 +46,7 @@ if( 'POST' === $_SERVER['REQUEST_METHOD'] ) {
<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', $timestamp)</option>
<option value="ParseStr" <?php echo selected($action_str, 'ParseStr'); ?>>parse_str()</option>
<select>
<input type="submit">
</form>