Author: marijn
Date: 2010-01-12 01:09:54 +0100 (Tue, 12 Jan 2010)
New Revision: 26510
Modified:
plugins/sfPaymentPlugin/branches/1.2-marijn/lib/action/sfPaymentActionAbstract.php
Log:
[sfPaymentPlugin] `sfPaymentActionAbstract#_processForm` method now accepts a
callable as a route argument. The related transaction object will be passed as
an argument to the callable.
Modified:
plugins/sfPaymentPlugin/branches/1.2-marijn/lib/action/sfPaymentActionAbstract.php
===================================================================
---
plugins/sfPaymentPlugin/branches/1.2-marijn/lib/action/sfPaymentActionAbstract.php
2010-01-12 00:03:00 UTC (rev 26509)
+++
plugins/sfPaymentPlugin/branches/1.2-marijn/lib/action/sfPaymentActionAbstract.php
2010-01-12 00:09:54 UTC (rev 26510)
@@ -16,10 +16,10 @@
*
* @param sfPaymentFormAbstract $arg_form The form to process.
* @param sfWebRequest $arg_request The request object.
- * @param String $arg_route The route to which the
form data should be submitted.
- * @param String $arg_method The form submit method.
+ * @param mixed $arg_route The route to which the
form data should be submitted.
+ * @param string $arg_method The form submit method.
*
- * @return String The view type to render.
+ * @return string The view type to render.
*/
protected function _processForm (sfPaymentFormAbstract $arg_form,
sfWebRequest $arg_request, $arg_route, $arg_method = 'post')
{
@@ -31,9 +31,12 @@
if ($arg_form->isValid())
{
- $this->redirect(array('sf_route' => $arg_route
- ,'sf_subject' =>
$this->_doProcessForm($arg_form)
- ));
+ $object = $this->_doProcessForm($arg_form);
+ $route = is_callable($arg_route) ? call_user_func($arg_route,
$object) : array('sf_route' => $arg_route
+
,'sf_subject' => $object
+
);
+
+ $this->redirect($route);
}
}
--
You received this message because you are subscribed to the Google Groups
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/symfony-svn?hl=en.