Form processing is now factorized in BaseAction

This commit is contained in:
franck
2013-08-08 11:13:46 +02:00
parent 13bed6d3fc
commit 4e83466bc0
7 changed files with 250 additions and 225 deletions

View File

@@ -154,7 +154,7 @@ class BaseAdminController extends ContainerAware
$actionEvent = $eventFactory->createActionEvent();
$this->getDispatcher()->dispatch("action.$action", $actionEvent);
$this->dispatch("action.$action", $actionEvent);
if ($actionEvent->hasErrorForm()) {
$this->getParserContext()->setErrorForm($actionEvent->getErrorForm());
@@ -163,6 +163,17 @@ class BaseAdminController extends ContainerAware
return $actionEvent;
}
/**
* Dispatch a Thelia event to modules
*
* @param string $eventName a TheliaEvent name, as defined in TheliaEvents class
* @param ActionEvent $event the event
*/
protected function dispatch($eventName, ActionEvent $event = null) {
$this->getDispatcher()->dispatch($eventName, $event);
}
/**
* Return the event dispatcher,
*