From fa8dbaadfc31ac140257ced529a057360d2489c0 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Tue, 28 Jul 2015 11:48:42 +0200 Subject: [PATCH] QuickForm: add getSentValue() helper method --- library/Director/Web/Form/QuickForm.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/library/Director/Web/Form/QuickForm.php b/library/Director/Web/Form/QuickForm.php index 464cc7f1..dff0a1dc 100644 --- a/library/Director/Web/Form/QuickForm.php +++ b/library/Director/Web/Form/QuickForm.php @@ -97,6 +97,17 @@ abstract class QuickForm extends Zend_Form $this->getElement(self::ID)->setIgnore(true); } + protected function getSentValue($name, $default = null) + { + $request = $this->getRequest(); + + if ($request->isPost()) { + return $request->getPost($name); + } else { + return $default; + } + } + public function getSubmitLabel() { if ($this->submitLabel === null) {