/** * Execute the action */ public function execute() { $this->email = $this->getParameter('email'); // does the item exist if (BackendMailmotorModel::existsAddress($this->email)) { parent::execute(); $this->getData(); $this->loadForm(); $this->loadCustomFields(); $this->validateForm(); $this->parse(); $this->display(); } else { $this->redirect(BackendModel::createURLForAction('index') . '&error=non-existing'); } }
/** * Execute the action * * @return void */ public function execute() { // get parameters $this->email = $this->getParameter('email'); // does the item exist if (BackendMailmotorModel::existsAddress($this->email)) { // call parent, this will probably add some general CSS/JS or other required files parent::execute(); // get all data for the item we want to edit $this->getData(); // load the form $this->loadForm(); // load the custom fields $this->loadCustomFields(); // validate the form $this->validateForm(); // parse $this->parse(); // display the page $this->display(); } else { $this->redirect(BackendModel::createURLForAction('index') . '&error=non-existing'); } }