Form processing is now factorized in BaseAction
This commit is contained in:
@@ -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,
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user