. */ namespace SP\Modules\Web\Controllers\Account; use Exception; use SP\Core\Events\Event; use SP\Domain\Core\Acl\AclActionsInterface; use SP\Modules\Web\Util\ErrorUtil; /** * Class CreateController */ final class CreateController extends AccountViewBase { /** * Create action */ public function createAction(): void { try { $this->accountHelper->setViewForBlank(AclActionsInterface::ACCOUNT_CREATE); $this->view->addTemplate('account'); $this->view->assign( 'title', [ 'class' => 'titleGreen', 'name' => __('New Account'), 'icon' => $this->icons->add()->getIcon(), ] ); $this->view->assign('formRoute', 'account/saveCreate'); $this->eventDispatcher->notify('show.account.create', new Event($this)); if ($this->isAjax === false) { $this->upgradeView(); } $this->view(); } catch (Exception $e) { processException($e); if ($this->isAjax === false && !$this->view->isUpgraded()) { $this->upgradeView(); } ErrorUtil::showExceptionInView($this->view, $e, 'account'); } } }