From 439a9b5e8a8df0ebcd0eb6c61be3a083535bfb87 Mon Sep 17 00:00:00 2001 From: Matthew Batchelder Date: Thu, 25 Jul 2013 13:49:28 -0400 Subject: [PATCH] Add serialize() action --- classes.php | 14 ++++++++++++++ index.php | 1 + 2 files changed, 15 insertions(+) diff --git a/classes.php b/classes.php index dbd1aea..047f8be 100644 --- a/classes.php +++ b/classes.php @@ -124,6 +124,20 @@ class ActionUrlencode extends AbstractAction } } +class ActionSerialize extends AbstractAction +{ + public function setUp() + { + $this->setContainer( new TextareaContainer ); + $this->setFormatter( new EchoFormatter ); + } + + public function decode() + { + return serialize( $this->value ); + } +} + class ActionUnserialize extends AbstractAction { public function setUp() diff --git a/index.php b/index.php index b15c4db..a53dd93 100644 --- a/index.php +++ b/index.php @@ -38,6 +38,7 @@ if( 'POST' === $_SERVER['REQUEST_METHOD'] ) { +